{-|
Module      : Gargantext.Types
Description : 
Copyright   : (c) CNRS, 2017-Present
License     : AGPL + CECILL v3
Maintainer  : team@gargantext.org
Stability   : experimental
Portability : POSIX

Here is a longer description of this module, containing some
commentary with @some markup@.
-}

------------------------------------------------------------------------
{-# LANGUAGE TemplateHaskell      #-}

module Gargantext.Core.Types ( module Gargantext.Core.Types.Main
                             , module Gargantext.Database.Admin.Types.Node
                             , Term, Terms(..)
                             , TokenTag(..), POS(..), NER(..)
                             , Label, Stems
                             , HasInvalidError(..), assertValid
                             , Name
                             , TableResult(..), NodeTableResult
                             , Ordering(..)
                             , Typed(..), withType , unTyped
                             , TODO(..)
                             ) where

import Control.Lens (Prism', (#), makeLenses, over)
import Control.Monad.Except (MonadError(throwError))
import Data.Aeson
import Data.Aeson.TH (deriveJSON)
import Data.Hashable (Hashable)
import Data.Maybe
import Data.Monoid
import Data.Semigroup
import Data.Set (Set, empty)
import Data.Swagger (ToParamSchema)
import Data.Swagger (ToSchema(..))
import Data.Text (Text, unpack)
import Data.Validity
import GHC.Generics
import Gargantext.Core.Types.Main
import Gargantext.Core.Utils.Prefix (unPrefix, wellNamedSchema)
import Gargantext.Database.Admin.Types.Node
import Gargantext.Prelude
import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)

------------------------------------------------------------------------
data Ordering = Down | Up
  deriving (Int -> Ordering
Ordering -> Int
Ordering -> [Ordering]
Ordering -> Ordering
Ordering -> Ordering -> [Ordering]
Ordering -> Ordering -> Ordering -> [Ordering]
(Ordering -> Ordering)
-> (Ordering -> Ordering)
-> (Int -> Ordering)
-> (Ordering -> Int)
-> (Ordering -> [Ordering])
-> (Ordering -> Ordering -> [Ordering])
-> (Ordering -> Ordering -> [Ordering])
-> (Ordering -> Ordering -> Ordering -> [Ordering])
-> Enum Ordering
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering]
$cenumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering]
enumFromTo :: Ordering -> Ordering -> [Ordering]
$cenumFromTo :: Ordering -> Ordering -> [Ordering]
enumFromThen :: Ordering -> Ordering -> [Ordering]
$cenumFromThen :: Ordering -> Ordering -> [Ordering]
enumFrom :: Ordering -> [Ordering]
$cenumFrom :: Ordering -> [Ordering]
fromEnum :: Ordering -> Int
$cfromEnum :: Ordering -> Int
toEnum :: Int -> Ordering
$ctoEnum :: Int -> Ordering
pred :: Ordering -> Ordering
$cpred :: Ordering -> Ordering
succ :: Ordering -> Ordering
$csucc :: Ordering -> Ordering
Enum, Int -> Ordering -> ShowS
[Ordering] -> ShowS
Ordering -> String
(Int -> Ordering -> ShowS)
-> (Ordering -> String) -> ([Ordering] -> ShowS) -> Show Ordering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ordering] -> ShowS
$cshowList :: [Ordering] -> ShowS
show :: Ordering -> String
$cshow :: Ordering -> String
showsPrec :: Int -> Ordering -> ShowS
$cshowsPrec :: Int -> Ordering -> ShowS
Show, Ordering -> Ordering -> Bool
(Ordering -> Ordering -> Bool)
-> (Ordering -> Ordering -> Bool) -> Eq Ordering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ordering -> Ordering -> Bool
$c/= :: Ordering -> Ordering -> Bool
== :: Ordering -> Ordering -> Bool
$c== :: Ordering -> Ordering -> Bool
Eq, Ordering
Ordering -> Ordering -> Bounded Ordering
forall a. a -> a -> Bounded a
maxBound :: Ordering
$cmaxBound :: Ordering
minBound :: Ordering
$cminBound :: Ordering
Bounded)

------------------------------------------------------------------------
type Name = Text
type Term  = Text
type Stems = Set Text
type Label = [Text]

data Terms = Terms { Terms -> Label
_terms_label :: Label
                   , Terms -> Stems
_terms_stem  :: Stems
                   } deriving (Eq Terms
Eq Terms
-> (Terms -> Terms -> Ordering)
-> (Terms -> Terms -> Bool)
-> (Terms -> Terms -> Bool)
-> (Terms -> Terms -> Bool)
-> (Terms -> Terms -> Bool)
-> (Terms -> Terms -> Terms)
-> (Terms -> Terms -> Terms)
-> Ord Terms
Terms -> Terms -> Bool
Terms -> Terms -> Ordering
Terms -> Terms -> Terms
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Terms -> Terms -> Terms
$cmin :: Terms -> Terms -> Terms
max :: Terms -> Terms -> Terms
$cmax :: Terms -> Terms -> Terms
>= :: Terms -> Terms -> Bool
$c>= :: Terms -> Terms -> Bool
> :: Terms -> Terms -> Bool
$c> :: Terms -> Terms -> Bool
<= :: Terms -> Terms -> Bool
$c<= :: Terms -> Terms -> Bool
< :: Terms -> Terms -> Bool
$c< :: Terms -> Terms -> Bool
compare :: Terms -> Terms -> Ordering
$ccompare :: Terms -> Terms -> Ordering
$cp1Ord :: Eq Terms
Ord)

instance Eq Terms where
  == :: Terms -> Terms -> Bool
(==) (Terms Label
_ Stems
s1) (Terms Label
_ Stems
s2) = Stems
s1 Stems -> Stems -> Bool
forall a. Eq a => a -> a -> Bool
== Stems
s2

------------------------------------------------------------------------
data Tag = POS | NER
  deriving (Int -> Tag -> ShowS
[Tag] -> ShowS
Tag -> String
(Int -> Tag -> ShowS)
-> (Tag -> String) -> ([Tag] -> ShowS) -> Show Tag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tag] -> ShowS
$cshowList :: [Tag] -> ShowS
show :: Tag -> String
$cshow :: Tag -> String
showsPrec :: Int -> Tag -> ShowS
$cshowsPrec :: Int -> Tag -> ShowS
Show, Tag -> Tag -> Bool
(Tag -> Tag -> Bool) -> (Tag -> Tag -> Bool) -> Eq Tag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tag -> Tag -> Bool
$c/= :: Tag -> Tag -> Bool
== :: Tag -> Tag -> Bool
$c== :: Tag -> Tag -> Bool
Eq)
------------------------------------------------------------------------
data POS = NP
         | JJ  | VB
         | CC  | IN | DT
         | NoPos
  deriving (Int -> POS -> ShowS
[POS] -> ShowS
POS -> String
(Int -> POS -> ShowS)
-> (POS -> String) -> ([POS] -> ShowS) -> Show POS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [POS] -> ShowS
$cshowList :: [POS] -> ShowS
show :: POS -> String
$cshow :: POS -> String
showsPrec :: Int -> POS -> ShowS
$cshowsPrec :: Int -> POS -> ShowS
Show, (forall x. POS -> Rep POS x)
-> (forall x. Rep POS x -> POS) -> Generic POS
forall x. Rep POS x -> POS
forall x. POS -> Rep POS x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep POS x -> POS
$cfrom :: forall x. POS -> Rep POS x
Generic, POS -> POS -> Bool
(POS -> POS -> Bool) -> (POS -> POS -> Bool) -> Eq POS
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: POS -> POS -> Bool
$c/= :: POS -> POS -> Bool
== :: POS -> POS -> Bool
$c== :: POS -> POS -> Bool
Eq, Eq POS
Eq POS
-> (POS -> POS -> Ordering)
-> (POS -> POS -> Bool)
-> (POS -> POS -> Bool)
-> (POS -> POS -> Bool)
-> (POS -> POS -> Bool)
-> (POS -> POS -> POS)
-> (POS -> POS -> POS)
-> Ord POS
POS -> POS -> Bool
POS -> POS -> Ordering
POS -> POS -> POS
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: POS -> POS -> POS
$cmin :: POS -> POS -> POS
max :: POS -> POS -> POS
$cmax :: POS -> POS -> POS
>= :: POS -> POS -> Bool
$c>= :: POS -> POS -> Bool
> :: POS -> POS -> Bool
$c> :: POS -> POS -> Bool
<= :: POS -> POS -> Bool
$c<= :: POS -> POS -> Bool
< :: POS -> POS -> Bool
$c< :: POS -> POS -> Bool
compare :: POS -> POS -> Ordering
$ccompare :: POS -> POS -> Ordering
$cp1Ord :: Eq POS
Ord)
------------------------------------------------------------------------
instance FromJSON POS where
  parseJSON :: Value -> Parser POS
parseJSON = String -> (Text -> Parser POS) -> Value -> Parser POS
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"String" (\Text
x -> POS -> Parser POS
forall (f :: * -> *) a. Applicative f => a -> f a
pure (String -> POS
pos (String -> POS) -> String -> POS
forall a b. (a -> b) -> a -> b
$ Text -> String
unpack Text
x))
    where
      pos :: [Char] -> POS
      pos :: String -> POS
pos String
"NP"  = POS
NP
      pos String
"NN"  = POS
NP
      pos String
"NC"  = POS
NP
      pos String
"NNS" = POS
NP
      pos String
"NNP" = POS
NP
      pos String
"JJ"  = POS
JJ
      pos String
"ADJ" = POS
JJ
      pos String
"VB"  = POS
VB
      pos String
"VBN" = POS
VB
      pos String
"VBG" = POS
VB
      pos String
"CC"  = POS
CC
      pos String
"IN"  = POS
IN
      pos String
"DT"  = POS
DT
      -- French specific
      pos String
"P"   = POS
IN
      pos  String
_    = POS
NoPos

instance ToJSON POS
instance Hashable POS
------------------------------------------------------------------------
data NER = PERSON | ORGANIZATION | LOCATION | NoNER
  deriving (Int -> NER -> ShowS
[NER] -> ShowS
NER -> String
(Int -> NER -> ShowS)
-> (NER -> String) -> ([NER] -> ShowS) -> Show NER
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NER] -> ShowS
$cshowList :: [NER] -> ShowS
show :: NER -> String
$cshow :: NER -> String
showsPrec :: Int -> NER -> ShowS
$cshowsPrec :: Int -> NER -> ShowS
Show, (forall x. NER -> Rep NER x)
-> (forall x. Rep NER x -> NER) -> Generic NER
forall x. Rep NER x -> NER
forall x. NER -> Rep NER x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NER x -> NER
$cfrom :: forall x. NER -> Rep NER x
Generic)
------------------------------------------------------------------------
instance FromJSON NER where
  parseJSON :: Value -> Parser NER
parseJSON = String -> (Text -> Parser NER) -> Value -> Parser NER
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"String" (\Text
x -> NER -> Parser NER
forall (f :: * -> *) a. Applicative f => a -> f a
pure (String -> NER
ner (String -> NER) -> String -> NER
forall a b. (a -> b) -> a -> b
$ Text -> String
unpack Text
x))
    where
      ner :: [Char] -> NER
      ner :: String -> NER
ner String
"PERSON"       = NER
PERSON
      ner String
"ORGANIZATION" = NER
ORGANIZATION
      ner String
"LOCATION"     = NER
LOCATION
      ner  String
_             = NER
NoNER

instance ToJSON NER

data TokenTag  = TokenTag { TokenTag -> Label
_my_token_word  :: [Text]
                          , TokenTag -> Stems
_my_token_lemma :: Set Text
                          , TokenTag -> Maybe POS
_my_token_pos   :: Maybe POS
                          , TokenTag -> Maybe NER
_my_token_ner   :: Maybe NER
                          } deriving (Int -> TokenTag -> ShowS
[TokenTag] -> ShowS
TokenTag -> String
(Int -> TokenTag -> ShowS)
-> (TokenTag -> String) -> ([TokenTag] -> ShowS) -> Show TokenTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TokenTag] -> ShowS
$cshowList :: [TokenTag] -> ShowS
show :: TokenTag -> String
$cshow :: TokenTag -> String
showsPrec :: Int -> TokenTag -> ShowS
$cshowsPrec :: Int -> TokenTag -> ShowS
Show)

instance Semigroup TokenTag where
  <> :: TokenTag -> TokenTag -> TokenTag
(<>) (TokenTag Label
w1 Stems
s1 Maybe POS
p1 Maybe NER
n1) (TokenTag Label
w2 Stems
s2 Maybe POS
p2 Maybe NER
_) = Label -> Stems -> Maybe POS -> Maybe NER -> TokenTag
TokenTag (Label
w1 Label -> Label -> Label
forall a. Semigroup a => a -> a -> a
<> Label
w2) (Stems
s1 Stems -> Stems -> Stems
forall a. Semigroup a => a -> a -> a
<> Stems
s2) Maybe POS
p3 Maybe NER
n1
    where
      p3 :: Maybe POS
p3 = case (Maybe POS
p1,Maybe POS
p2) of
        (Just POS
JJ, Just POS
NP) -> POS -> Maybe POS
forall a. a -> Maybe a
Just POS
NP
        (Just POS
VB, Just POS
NP) -> POS -> Maybe POS
forall a. a -> Maybe a
Just POS
NP
        (Maybe POS, Maybe POS)
_                  -> Maybe POS
p1


instance Monoid TokenTag where
  mempty :: TokenTag
mempty = Label -> Stems -> Maybe POS -> Maybe NER -> TokenTag
TokenTag [] Stems
forall a. Set a
empty Maybe POS
forall a. Maybe a
Nothing Maybe NER
forall a. Maybe a
Nothing
  mconcat :: [TokenTag] -> TokenTag
mconcat = (TokenTag -> TokenTag -> TokenTag)
-> TokenTag -> [TokenTag] -> TokenTag
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl TokenTag -> TokenTag -> TokenTag
forall a. Monoid a => a -> a -> a
mappend TokenTag
forall a. Monoid a => a
mempty
  -- mappend t1 t2 = (<>) t1 t2


class HasInvalidError e where
  _InvalidError :: Prism' e Validation

assertValid :: (MonadError e m, HasInvalidError e) => Validation -> m ()
assertValid :: Validation -> m ()
assertValid Validation
v = Bool -> m () -> m ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ Validation -> Bool
validationIsValid Validation
v) (m () -> m ()) -> m () -> m ()
forall a b. (a -> b) -> a -> b
$ e -> m ()
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (e -> m ()) -> e -> m ()
forall a b. (a -> b) -> a -> b
$ Tagged Validation (Identity Validation) -> Tagged e (Identity e)
forall e. HasInvalidError e => Prism' e Validation
_InvalidError (Tagged Validation (Identity Validation) -> Tagged e (Identity e))
-> Validation -> e
forall t b. AReview t b -> b -> t
# Validation
v
-- assertValid :: MonadBase IO m => Validation -> m ()
-- assertValid v = when (not $ validationIsValid v) $ fail $ show v

-- | NodeTableResult (Table computations)
type NodeTableResult a = TableResult (Node a)


data TableResult a = TableResult { TableResult a -> Int
tr_count :: Int
                                 , TableResult a -> [a]
tr_docs  :: [a]
                                 } deriving ((forall x. TableResult a -> Rep (TableResult a) x)
-> (forall x. Rep (TableResult a) x -> TableResult a)
-> Generic (TableResult a)
forall x. Rep (TableResult a) x -> TableResult a
forall x. TableResult a -> Rep (TableResult a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (TableResult a) x -> TableResult a
forall a x. TableResult a -> Rep (TableResult a) x
$cto :: forall a x. Rep (TableResult a) x -> TableResult a
$cfrom :: forall a x. TableResult a -> Rep (TableResult a) x
Generic)

$(deriveJSON (unPrefix "tr_") ''TableResult)

instance (Typeable a, ToSchema a) => ToSchema (TableResult a) where
  declareNamedSchema :: Proxy (TableResult a) -> Declare (Definitions Schema) NamedSchema
declareNamedSchema = Text
-> Proxy (TableResult a)
-> Declare (Definitions Schema) NamedSchema
forall a.
(Typeable a, Generic a, GToSchema (Rep a),
 GenericHasSimpleShape
   a
   "genericDeclareNamedSchemaUnrestricted"
   (GenericShape (Rep a))) =>
Text -> Proxy a -> Declare (Definitions Schema) NamedSchema
wellNamedSchema Text
"tr_"

instance Arbitrary a => Arbitrary (TableResult a) where
  arbitrary :: Gen (TableResult a)
arbitrary = Int -> [a] -> TableResult a
forall a. Int -> [a] -> TableResult a
TableResult (Int -> [a] -> TableResult a)
-> Gen Int -> Gen ([a] -> TableResult a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen Int
forall a. Arbitrary a => Gen a
arbitrary Gen ([a] -> TableResult a) -> Gen [a] -> Gen (TableResult a)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Gen [a]
forall a. Arbitrary a => Gen a
arbitrary

----------------------------------------------------------------------------
data Typed a b =
  Typed { Typed a b -> a
_withType :: a
        , Typed a b -> b
_unTyped  :: b
        }
  deriving ((forall x. Typed a b -> Rep (Typed a b) x)
-> (forall x. Rep (Typed a b) x -> Typed a b)
-> Generic (Typed a b)
forall x. Rep (Typed a b) x -> Typed a b
forall x. Typed a b -> Rep (Typed a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a b x. Rep (Typed a b) x -> Typed a b
forall a b x. Typed a b -> Rep (Typed a b) x
$cto :: forall a b x. Rep (Typed a b) x -> Typed a b
$cfrom :: forall a b x. Typed a b -> Rep (Typed a b) x
Generic, Int -> Typed a b -> ShowS
[Typed a b] -> ShowS
Typed a b -> String
(Int -> Typed a b -> ShowS)
-> (Typed a b -> String)
-> ([Typed a b] -> ShowS)
-> Show (Typed a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b. (Show a, Show b) => Int -> Typed a b -> ShowS
forall a b. (Show a, Show b) => [Typed a b] -> ShowS
forall a b. (Show a, Show b) => Typed a b -> String
showList :: [Typed a b] -> ShowS
$cshowList :: forall a b. (Show a, Show b) => [Typed a b] -> ShowS
show :: Typed a b -> String
$cshow :: forall a b. (Show a, Show b) => Typed a b -> String
showsPrec :: Int -> Typed a b -> ShowS
$cshowsPrec :: forall a b. (Show a, Show b) => Int -> Typed a b -> ShowS
Show, Typed a b -> Typed a b -> Bool
(Typed a b -> Typed a b -> Bool)
-> (Typed a b -> Typed a b -> Bool) -> Eq (Typed a b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a b. (Eq a, Eq b) => Typed a b -> Typed a b -> Bool
/= :: Typed a b -> Typed a b -> Bool
$c/= :: forall a b. (Eq a, Eq b) => Typed a b -> Typed a b -> Bool
== :: Typed a b -> Typed a b -> Bool
$c== :: forall a b. (Eq a, Eq b) => Typed a b -> Typed a b -> Bool
Eq, Eq (Typed a b)
Eq (Typed a b)
-> (Typed a b -> Typed a b -> Ordering)
-> (Typed a b -> Typed a b -> Bool)
-> (Typed a b -> Typed a b -> Bool)
-> (Typed a b -> Typed a b -> Bool)
-> (Typed a b -> Typed a b -> Bool)
-> (Typed a b -> Typed a b -> Typed a b)
-> (Typed a b -> Typed a b -> Typed a b)
-> Ord (Typed a b)
Typed a b -> Typed a b -> Bool
Typed a b -> Typed a b -> Ordering
Typed a b -> Typed a b -> Typed a b
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a b. (Ord a, Ord b) => Eq (Typed a b)
forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Bool
forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Ordering
forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Typed a b
min :: Typed a b -> Typed a b -> Typed a b
$cmin :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Typed a b
max :: Typed a b -> Typed a b -> Typed a b
$cmax :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Typed a b
>= :: Typed a b -> Typed a b -> Bool
$c>= :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Bool
> :: Typed a b -> Typed a b -> Bool
$c> :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Bool
<= :: Typed a b -> Typed a b -> Bool
$c<= :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Bool
< :: Typed a b -> Typed a b -> Bool
$c< :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Bool
compare :: Typed a b -> Typed a b -> Ordering
$ccompare :: forall a b. (Ord a, Ord b) => Typed a b -> Typed a b -> Ordering
$cp1Ord :: forall a b. (Ord a, Ord b) => Eq (Typed a b)
Ord)

makeLenses ''Typed

instance Functor (Typed a) where
  fmap :: (a -> b) -> Typed a a -> Typed a b
fmap = ASetter (Typed a a) (Typed a b) a b
-> (a -> b) -> Typed a a -> Typed a b
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
over ASetter (Typed a a) (Typed a b) a b
forall a b b. Lens (Typed a b) (Typed a b) b b
unTyped

----------------------------------------------------------------------------
-- TO BE removed
data TODO = TODO
  deriving ((forall x. TODO -> Rep TODO x)
-> (forall x. Rep TODO x -> TODO) -> Generic TODO
forall x. Rep TODO x -> TODO
forall x. TODO -> Rep TODO x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TODO x -> TODO
$cfrom :: forall x. TODO -> Rep TODO x
Generic)

instance ToSchema TODO where
instance ToParamSchema TODO where
----------------------------------------------------------------------------