Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.MGeneric
- type family f :$: as :: *
- data Un s
- data Field s
- data In u ps :: * where
- data InField f ps :: * where
- type family ExpandField f ps :: *
- type family ExpandFields f ps :: [*]
- class MGeneric a where
Documentation
Universe kind
The s parameter should always be *
Field kind
The s parameter should always be *
(FK a) can be replaced by (a :@: []), but the empty application case is often handled differently in generic type classes
Instances
type family ExpandField f ps :: * Source
Equations
ExpandField (FK a) ps = a | |
ExpandField (FP n) ps = ps :!: n | |
ExpandField (f :@: as) ps = f :$: ExpandFields as ps |
type family ExpandFields f ps :: [*] Source
Equations
ExpandFields [] ps = [] | |
ExpandFields (FK a : fs) ps = a : ExpandFields fs ps | |
ExpandFields (FP n : fs) ps = (ps :!: n) : ExpandFields fs ps | |
ExpandFields ((f :@: as) : fs) ps = (f :$: ExpandFields as ps) : ExpandFields fs ps |
Representable types with parameters
Associated Types
Representation of a
Parameters of a
Methods
from :: a -> In (Rep a) (Pars a) Source
Convert from the datatype to its representation
to :: In (Rep a) (Pars a) -> a Source
Convert to the datatype from its representation
Instances
MGeneric Bool | |
MGeneric Ordering | |
MGeneric () | |
MGeneric [a] | |
MGeneric (Endo a) | |
MGeneric (Sum a) | |
MGeneric (Product a) | |
MGeneric (First a) | |
MGeneric (Last a) | |
MGeneric (Maybe a) | |
MGeneric (Identity a) | |
MGeneric (Either a b) | |
MGeneric (a, b) | |
MGeneric (Const a b) | |
MGeneric (a, b, c) | |
MGeneric (a, b, c, d) | |
MGeneric (a, b, c, d, e) | |
MGeneric (a, b, c, d, e, f) | |
MGeneric (a, b, c, d, e, f, g) | |
MGeneric (a, b, c, d, e, f, g, h) | |
MGeneric (a, b, c, d, e, f, g, h, i) |