multistate-0.6.0.0: like mtl's ReaderT / WriterT / StateT, but more than one contained value/type.

Safe HaskellNone
LanguageHaskell2010

Data.HList.HList

Description

A GADT HList implementation

Probably exists somewhere else already, but why add a dependency for something so simple.

Documentation

data HList :: [*] -> * where Source

Constructors

HNil :: HList [] 
(:+:) :: x -> HList xs -> HList (x : xs) infixr 5 

Instances

(Eq x, Eq (HList xs)) => Eq (HList ((:) * x xs)) 
Eq (HList ([] *)) 
(Show a, Show (HList b)) => Show (HList ((:) * a b)) 
Show (HList ([] *)) 
(Monoid x, Monoid (HList xs)) => Monoid (HList ((:) * x xs)) 
Monoid (HList ([] *)) 

type family Append l1 l2 :: [*] Source

Instances

type Append ([] *) l2 = l2 
type Append ((:) * car1 cdr2) l2 = (:) * car1 (Append cdr2 l2) 

hAppend :: HList ts1 -> HList ts2 -> HList (Append ts1 ts2) Source

class HInit l1 where Source

Methods

hInit :: forall l2. Proxy l2 -> HList (Append l1 l2) -> HList l1 Source

hSplit :: forall l2. HList (Append l1 l2) -> (HList l1, HList l2) Source

Instances

HInit ([] *) 
HInit l1 => HInit ((:) * x l1)