yggdrasil-0.1.0.0: Executable specifications of composable cryptographic protocols.

Safe HaskellSafe
LanguageHaskell2010

Yggdrasil.HList

Description

Provides heterogeneous lists through HList, as well as some type and value level operations on them.

Synopsis

Documentation

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

A heterogeneous list.

Constructors

Nil :: HList '[] 
(:::) :: a -> HList as -> HList (a ': as) infixr 5 

type family (as :: [k]) +|+ (bs :: [k]) :: [k] where ... Source #

Type-level appending of lists.

Equations

'[] +|+ bs = bs 
(a ': as) +|+ bs = a ': (as +|+ bs) 

class HAppend as bs where Source #

Value-level appending of HLists.

Minimal complete definition

(+++)

Methods

(+++) :: HList as -> HList bs -> HList (as +|+ bs) Source #

Instances
HAppend ([] :: [*]) bs Source # 
Instance details

Defined in Yggdrasil.HList

Methods

(+++) :: HList [] -> HList bs -> HList ([] +|+ bs) Source #

HAppend as bs => HAppend (a ': as) bs Source # 
Instance details

Defined in Yggdrasil.HList

Methods

(+++) :: HList (a ': as) -> HList bs -> HList ((a ': as) +|+ bs) Source #

class HSplit hs as bs where Source #

Split a HList at the value level given the type-level components.

Minimal complete definition

hsplit

Methods

hsplit :: HList hs -> (HList as, HList bs) Source #

Instances
HSplit bs ([] :: [*]) bs Source # 
Instance details

Defined in Yggdrasil.HList

Methods

hsplit :: HList bs -> (HList [], HList bs) Source #

HSplit hs as bs => HSplit (a ': hs) (a ': as) bs Source # 
Instance details

Defined in Yggdrasil.HList

Methods

hsplit :: HList (a ': hs) -> (HList (a ': as), HList bs) Source #