Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data SumType = SumType TypeInfo [DataConstructor]
- toSumType :: forall t. (Generic t, Typeable t, GDataConstructor (Rep t)) => Proxy t -> SumType
- data DataConstructor = DataConstructor {
- sigConstructor :: !Text
- sigValues :: !(Either [TypeInfo] [RecordEntry])
- data RecordEntry = RecordEntry {}
- class GDataConstructor f where
- gToConstructors :: f a -> [DataConstructor]
- class GRecordEntry f where
- gToRecordEntries :: f a -> [RecordEntry]
- getUsedTypes :: SumType -> [TypeInfo]
- constructorToType :: DataConstructor -> [TypeInfo] -> [TypeInfo]
Documentation
Generic representation of your Haskell types, the contained (leaf) types can be modified to match
compatible PureScript types, by using TypeBridge
functions like defaultBridge
with writePSTypes
.
toSumType :: forall t. (Generic t, Typeable t, GDataConstructor (Rep t)) => Proxy t -> SumType 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 Source
DataConstructor | |
|
class GDataConstructor f where Source
gToConstructors :: f a -> [DataConstructor] Source
(GDataConstructor a, GDataConstructor b) => GDataConstructor ((:+:) a b) Source | |
(Datatype a, GDataConstructor c) => GDataConstructor (D1 a c) Source | |
(Constructor a, GRecordEntry b) => GDataConstructor (C1 a b) Source |
class GRecordEntry f where Source
gToRecordEntries :: f a -> [RecordEntry] Source
GRecordEntry U1 Source | |
(GRecordEntry a, GRecordEntry b) => GRecordEntry ((:*:) a b) Source | |
(Selector a, Typeable * t) => GRecordEntry (S1 a (K1 R t)) Source |
getUsedTypes :: SumType -> [TypeInfo] Source
constructorToType :: DataConstructor -> [TypeInfo] -> [TypeInfo] Source