| Portability | see LANGUAGE pragmas (... GHC) |
|---|---|
| Stability | experimental |
| Maintainer | nicolas.frisby@gmail.com |
| Safe Haskell | None |
Data.Yoko.HCompos
Description
The generic homomorphism or "heterogenous compos".
See the paper "A Pattern for Almost Homomorphic Functions" at http://www.ittc.ku.edu/~nfrisby/frisby-2012-wgp.pdf, presented at the Workshop on Generic Programming 2012.
- type family Idiom cnv :: * -> *
- class Applicative (Idiom cnv) => Convert cnv a b where
- class Applicative (Idiom cnv) => HCompos cnv a t where
- data FoundDC star
- = NoCorrespondingConstructorFor_In_ star star
- | Match star
- type family WithMessage dcA b dcB :: FoundDC *
- type family FindDCs s dcBs :: Maybe *
- data ResultsInIncompatibleFields dcA dcB = ResultsInIncompatibleFields
- class Applicative (Idiom cnv) => MapRs cnv msg dc dc' prod prod' where
Documentation
class Applicative (Idiom cnv) => Convert cnv a b whereSource
Use the conversion cnv to convert from a to b.
Instances
| (Applicative (Idiom (a -> i b)), Applicative i, ~ * a x, ~ * b y) => Convert (a -> i b) x y |
class Applicative (Idiom cnv) => HCompos cnv a t whereSource
The generic version of convert; operates on disbanded data types.
Instances
| (Applicative (Idiom cnv), Generic dcA, ~ (FoundDC *) (Match * dcB) (WithMessage dcA b (FindDCs (Tag dcA) (DCs b))), MapRs cnv (ResultsInIncompatibleFields dcA dcB) dcA dcB (Rep dcA) (Rep dcB), DC dcB, ~ * (Codomain dcB) b, DT b) => HCompos cnv (N dcA) b | |
| (Applicative (Idiom cnv), HCompos cnv a t, HCompos cnv b t) => HCompos cnv (:+: a b) t |
Constructors
| NoCorrespondingConstructorFor_In_ star star | |
| Match star |
type family WithMessage dcA b dcB :: FoundDC *Source
type family FindDCs s dcBs :: Maybe *Source
FindDCs dcA dcBs returns a type-level Maybe. Just dcB is a fields
type dcB where .
Tag dcA ~ dcB
data ResultsInIncompatibleFields dcA dcB Source
Constructors
| ResultsInIncompatibleFields |
class Applicative (Idiom cnv) => MapRs cnv msg dc dc' prod prod' whereSource
Same as compos semantics, but with a generalized type and just for
converting between product representations.
Instances
| Applicative (Idiom cnv) => MapRs cnv msg dc dc' U U | |
| Applicative (Idiom cnv) => MapRs cnv msg dc dc' (Dep a) (Dep a) | |
| (Applicative (Idiom cnv), Convert cnv a b) => MapRs cnv msg dc dc' (Rec a) (Rec b) | |
| (Applicative (Idiom cnv), Traversable f, MapRs cnv msg dc dc' a a') => MapRs cnv msg dc dc' (Par1 f a) (Par1 f a') | |
| (Applicative (Idiom cnv), MapRs cnv msg dc dc' a a', MapRs cnv msg dc dc' b b') => MapRs cnv msg dc dc' (:*: a b) (:*: a' b') | |
| (Applicative (Idiom cnv), Bitraversable f, MapRs cnv msg dc dc' a a', MapRs cnv msg dc dc' b b') => MapRs cnv msg dc dc' (Par2 f a b) (Par2 f a' b') |