yoko-0.3.2.1: Generic Programming with Disbanded Data Types

Portabilitysee LANGUAGE pragmas (... GHC)
Stabilityexperimental
Maintainernicolas.frisby@gmail.com
Safe HaskellSafe-Infered

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/papers/yoko.pdf, submitted to ICFP 2012.

Synopsis

Documentation

type family Idiom cnv :: * -> *Source

The applicative functor required by the conversion.

class Applicative (Idiom cnv) => HCompos cnv a t whereSource

The conversion cnv can convert from a to t.

Methods

hcompos :: cnv -> a -> Idiom cnv tSource

Instances

(Generic dc, ~ * (Just (N dc')) (FindDCs (Tag dc) (DCs t)), HComposRs cnv (Rep dc) (Rep dc'), DC dc', ~ * (Range dc') t, DT t) => HCompos cnv (N dc) t 
(HCompos cnv a t, HCompos cnv b t) => HCompos cnv (:+: a b) t 
HCompos cnv sum t => HCompos cnv (DCsOf a sum) t 

type family FindDCs s sum Source

FindDCs s sum returns a type-level Maybe. Just dc is a fields type dc where Tag dc ~ s.