purescript-bridge-0.6.0.1: Generate PureScript data types from Haskell data types

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Bridge.SumType

Synopsis

Documentation

data SumType lang Source

Generic representation of your Haskell types.

Constructors

SumType (TypeInfo lang) [DataConstructor lang] 

Instances

mkSumType :: forall t. (Generic t, Typeable t, GDataConstructor (Rep t)) => Proxy t -> SumType Haskell Source

Create a representation of your sum (and product) types, for doing type translations and writing it out to your PureScript modules. In order to get the type information we use a dummy variable of type Proxy (YourType).

data DataConstructor lang Source

Constructors

DataConstructor 

Fields

_sigConstructor :: !Text
 
_sigValues :: !(Either [TypeInfo lang] [RecordEntry lang])
 

Instances

data RecordEntry lang Source

Constructors

RecordEntry 

Fields

_recLabel :: !Text
 
_recValue :: !(TypeInfo lang)
 

Instances

sigValues :: forall lang lang. Lens (DataConstructor lang) (DataConstructor lang) (Either [TypeInfo lang] [RecordEntry lang]) (Either [TypeInfo lang] [RecordEntry lang]) Source

sumTypeInfo :: Functor f => (TypeInfo lang -> f (TypeInfo lang)) -> SumType lang -> f (SumType lang) Source

TypInfo lens for SumType.

sumTypeConstructors :: Functor f => ([DataConstructor lang] -> f [DataConstructor lang]) -> SumType lang -> f (SumType lang) Source

DataConstructor lens for SumType.

recLabel :: forall lang. Lens' (RecordEntry lang) Text Source

recValue :: forall lang lang. Lens (RecordEntry lang) (RecordEntry lang) (TypeInfo lang) (TypeInfo lang) Source