generics-sop-0.1.1.1: Generic Programming using True Sums of Products

Safe HaskellSafe-Inferred
LanguageHaskell2010

Generics.SOP.BasicFunctors

Description

Basic functors.

Definitions of the type-level equivalents of const, id, and (.), and a definition of the lifted function space.

These datatypes are generally useful, but in this library, they're primarily used as parameters for the NP, NS, POP, and SOP types.

Synopsis

Documentation

newtype K a b Source

The constant type functor.

Like Constant, but kind-polymorphic in its second argument and with a shorter name.

Constructors

K a 

Instances

Functor (K * a) 
Monoid a => Applicative (K * a) 
Foldable (K * a) 
Traversable (K * a) 
Show a => Show (K k a b) 
Generic (K k a b) 
HasDatatypeInfo (K * a b) 
Generic (K * a b) 
type Rep (K k a b) 
type Code (K * a0 b0) = (:) [*] ((:) * a0 ([] *)) ([] [*]) 

unK :: K a b -> a Source

Extract the contents of a K value.

newtype I a Source

The identity type functor.

Like Identity, but with a shorter name.

Constructors

I a 

Instances

Monad I 
Functor I 
Applicative I 
Foldable I 
Traversable I 
Show a => Show (I a) 
Generic (I a) 
HasDatatypeInfo (I a) 
Generic (I a) 
Typeable (k -> I k) (I k) 
type Rep (I a) 
type Code (I a0) = (:) [*] ((:) * a0 ([] *)) ([] [*]) 

unI :: I a -> a Source

Extract the contents of an I value.

newtype (f :.: g) p infixr 7 Source

Composition of functors.

Like Compose, but kind-polymorphic and with a shorter name.

Constructors

Comp (f (g p)) 

Instances

(Functor f, Functor g) => Functor ((:.:) * * f g) 
Show (f (g p)) => Show ((:.:) l k f g p) 
Generic ((:.:) l k f g p) 
HasDatatypeInfo ((:.:) * * f g p) 
Generic ((:.:) * * f g p) 
type Rep ((:.:) l k f g p) 
type Code ((:.:) * * f0 g0 p0) = (:) [*] ((:) * (f0 (g0 p0)) ([] *)) ([] [*]) 

unComp :: (f :.: g) p -> f (g p) Source

Extract the contents of a Comp value.