extensible-0.2.1: 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

(<$?~) :: (forall b. f b -> (b -> x) -> a) -> (Match (Flux x) a :* fs) -> Match (Flux x) a :* (f : fs) infixr 1 Source

Prepend a clause for Match (Flux x) as well as (<?!).

newtype Union fs a Source

A much more efficient representation for Union of Functors.

Constructors

Union 

Fields

getLeague :: Flux a :| fs
 

Instances

Functor (Union fs)

fast fmap

Typeable ([* -> *] -> * -> *) Union 

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

O(log n) Embed a value.

data Flux a f where Source

Flipped Coyoneda

Constructors

Flux :: (a -> b) -> f a -> Flux b f 

mapFlux :: (a -> b) -> Flux a f -> Flux b f Source

fmap for the content.