extensible-0.2: Poly-kinded, extensible ADTs

Copyright(c) Fumiaki Kinoshita 2015
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Union

Description

 

Synopsis

Documentation

newtype K1 a f Source

Wrap a type that has a kind * -> *.

Constructors

K1 

Fields

getK1 :: f a
 

Instances

Eq (f a) => Eq (K1 a f) 
Ord (f a) => Ord (K1 a f) 
Read (f a) => Read (K1 a f) 
Show (f a) => Show (K1 a f) 
Typeable (* -> (* -> *) -> *) K1 

(<?!) :: (f x -> a) -> (Match (K1 x) a :* xs) -> Match (K1 x) a :* (f : fs) infixr 1 Source

Prepend a clause for a parameterized value.

newtype Union fs a Source

A wrapper for K1 a ':|'' fs for having a kind * -> *.

Constructors

Union 

Fields

getUnion :: K1 a :| fs
 

Instances

(Functor f, Functor (Union fs)) => Functor (Union ((:) (* -> *) f fs))

slow fmap

Functor (Union ([] (* -> *))) 
(Show (f a), Show (Union fs a)) => Show (Union ((:) (* -> *) f fs) a) 
Show (Union ([] (* -> *)) a) 
Typeable ([* -> *] -> * -> *) Union 

liftU :: f fs => f a -> Union fs a Source

O(log n) Lift a value.