operational-alacarte-0.1.1: A version of Operational suitable for extensible EDSLs

Safe HaskellNone
LanguageHaskell2010

Data.ALaCarte

Description

Higher-order (and poly-kinded) implementation of Data Types à la Carte [1]

[1] W. Swierstra. Data Types à la Carte. Journal of Functional Programming, 18(4):423-436, 2008, http://dx.doi.org/10.1017/S0956796808006758.

Synopsis

Documentation

data (f :+: g) a b infixr 9 Source

Coproducts

Constructors

Inl (f a b) 
Inr (g a b) 

Instances

(:<:) k k1 f h => (:<:) k k f ((:+:) k k g h) Source 
(:<:) k k f ((:+:) k k f g) Source 
(HFunctor k k1 h1, HFunctor k k1 h2) => HFunctor k k ((:+:) (k -> *) k h1 h2) Source 
(Interp i1 m, Interp i2 m) => Interp ((:+:) (* -> *) * i1 i2) m Source 
(Functor (f a), Functor (g a)) => Functor ((:+:) k * f g a) Source 

class f :<: g where Source

A constraint f :<: g expresses that the signature f is subsumed by g, i.e. f can be used to construct elements in g.

Methods

inj :: f a b -> g a b Source

prj :: g a b -> Maybe (f a b) Source

Instances

(:<:) k k f f Source 
(:<:) k k1 f h => (:<:) k k f ((:+:) k k g h) Source 
(:<:) k k f ((:+:) k k f g) Source 

class HFunctor h where Source

Higher-order functors

Methods

hfmap :: (forall b. m b -> n b) -> h m a -> h n a Source

Higher-order fmap

Instances

(HFunctor k k1 h1, HFunctor k k1 h2) => HFunctor k k ((:+:) (k -> *) k h1 h2) Source