mgeneric-0.0.0.2: Generics with multiple parameters

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HList

Documentation

data HList as where Source

Constructors

HNil :: HList [] 
HCons :: a -> HList as -> HList (a : as) infixr 6 

class HNth as n where Source

Methods

hnth :: HList as -> Proxy n -> as :!: n Source

Instances

HNth ((:) * a as) NZ 
HNth as n => HNth ((:) * b as) (NS n) 

type family Map f as Source

Equations

Map f [] = [] 
Map f (a : as) = f a : Map f as 

class HMap as f g where Source

Methods

hmap :: Proxy as -> (forall i. f i -> g i) -> HList (Map f as) -> HList (Map g as) Source

Instances

HMap k ([] k) f g 
HMap k as f g => HMap k ((:) k a as) f g 

class HLookup n as where Source

Methods

hlookup :: Proxy n -> Proxy as -> HList as -> as :!: n Source

Instances

HLookup NZ ((:) * a as) 
HLookup n as => HLookup (NS n) ((:) * a as)