Safe Haskell | None |
---|

- data HList where
- class HLength xs where
- class List2HList x xs where
- list2hlist :: [x] -> HList (x : xs)

- class HList2List xs a | xs -> a where
- hlist2list :: xs -> [a]

- class HTake1 n xs1 xs2 | n xs1 -> xs2 where
- htake1 :: n -> xs1 -> xs2

- class HDrop1 n xs1 xs2 | n xs1 -> xs2 where
- hdrop1 :: n -> xs1 -> xs2

- class HMap f xs1 xs2 | f xs1 -> xs2 where
- hmap :: f -> xs1 -> xs2

- class TypeList t where
- class ConstraintBox box a where
- box :: a -> box
- unsafeUnbox :: box -> a

- class Downcast h box where
- downcast :: h -> [box]
- downcastAs :: (a -> box) -> h -> [box]

- data ShowBox = forall a . Show a => ShowBox !a
- data AnyBox = forall a . AnyBox !a
- type family HCons x xs :: *
- type family UnHList xs :: [a]
- type family HAppend xs ys :: *
- type family Distribute xs t :: [b]
- type family Replicate n x :: [a]
- type family Map f xs :: [b]
- type family Reverse xs :: [a]
- type family xs :! i :: a
- type family xs (++) ys :: [a]
- type family f ($) a :: b
- type family Concat xs :: [a]
- type family Length xs :: Nat
- type family Length1 xs :: Nat1
- data Nat1
- data Nat1Box n = Nat1Box
- type family ToNat1 n :: Nat1
- type family FromNat1 n :: Nat

# Heterogenous List

The heterogenous list

HMap f (HList ([] *)) (HList ([] *)) | |

(Eq x, Eq (HList xs)) => Eq (HList (: * x xs)) | |

Eq (HList ([] *)) | |

(Ord x, Ord (HList xs)) => Ord (HList (: * x xs)) | |

Ord (HList ([] *)) | |

(Show x, Show (HList xs)) => Show (HList (: * x xs)) | |

Show (HList ([] *)) | |

TypeList (HList xs) => Typeable (HList xs) | |

(Monoid x, Monoid (HList xs)) => Monoid (HList (: * x xs)) | |

Monoid (HList ([] *)) | |

HLength (HList xs) => HLength (HList (: * x xs)) | |

HLength (HList ([] *)) | |

(TypeList (HList xs), Typeable x) => TypeList (HList (: * x xs)) | |

TypeList (HList ([] *)) | |

(ConstraintBox box x, Downcast (HList xs) box) => Downcast (HList (: * x xs)) box | |

Downcast (HList ([] *)) a | |

HList2List (HList xs) a => HList2List (HList (: * a xs)) a | |

HList2List (HList ([] *)) a | |

DepIndex (HList xs) (Nat1Box n) => DepIndex (HList (: * x xs)) (Nat1Box (Succ n)) | |

DepIndex (HList (: * x xs)) (Nat1Box Zero) | |

DepIndex (HList ([] *)) (Nat1Box Zero) | |

HTake1 (Nat1Box n) (HList xs1) (HList xs2) => HTake1 (Nat1Box (Succ n)) (HList (: * x xs1)) (HList (: * x xs2)) | |

HTake1 (Nat1Box Zero) (HList xs1) (HList ([] *)) | |

HDrop1 (Nat1Box n) (HList xs1) (HList xs2) => HDrop1 (Nat1Box (Succ n)) (HList (: * x xs1)) (HList xs2) | |

HDrop1 (Nat1Box Zero) (HList xs1) (HList xs1) | |

HMap (x1 -> x2) (HList xs1) (HList xs2) => HMap (x1 -> x2) (HList (: * x1 xs1)) (HList (: * x2 xs2)) |

Used only for the HList class to determine its length

class List2HList x xs whereSource

For construction from lists

list2hlist :: [x] -> HList (x : xs)Source

List2HList x ([] *) | |

List2HList x xs => List2HList x (: * x xs) |

class HList2List xs a | xs -> a whereSource

For converting into a list

hlist2list :: xs -> [a]Source

HList2List (HList xs) a => HList2List (HList (: * a xs)) a | |

HList2List (HList ([] *)) a |

## Typeable

# Downcasting

class Downcast h box whereSource

downcastAs :: (a -> box) -> h -> [box]Source

# Boxes

Use this box unless you know for certain that your types won't have a show instance.

Show ShowBox | |

Show a => ConstraintBox ShowBox a |

# Type functions

## HList

## Type Lists

type family Distribute xs t :: [b]Source

## Type Nats

DepIndex (HList xs) (Nat1Box n) => DepIndex (HList (: * x xs)) (Nat1Box (Succ n)) | |

DepIndex (HList (: * x xs)) (Nat1Box Zero) | |

DepIndex (HList ([] *)) (Nat1Box Zero) | |

HTake1 (Nat1Box n) (HList xs1) (HList xs2) => HTake1 (Nat1Box (Succ n)) (HList (: * x xs1)) (HList (: * x xs2)) | |

HTake1 (Nat1Box Zero) (HList xs1) (HList ([] *)) | |

HDrop1 (Nat1Box n) (HList xs1) (HList xs2) => HDrop1 (Nat1Box (Succ n)) (HList (: * x xs1)) (HList xs2) | |

HDrop1 (Nat1Box Zero) (HList xs1) (HList xs1) |