Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Heterogeneous list utils
- data family HList (l :: [*])
- hHead :: HList (e ': l) -> e
- hTail :: HList (e ': l) -> HList l
- hLength :: forall xs. KnownNat (Length xs) => HList xs -> Word
- hAppend :: HAppendList l1 l2 => HList l1 -> HList l2 -> HList (Concat l1 l2)
- class HFoldr' f v (l :: [*]) r where
- class HFoldl' f (z :: *) xs (r :: *) where
- class HTuple' v t | v -> t, t -> v where
- class Apply f a b where
- class HZipList x y l | x y -> l, l -> x y where
- hZipList :: HZipList x y l => HList x -> HList y -> HList l
- class HFoldr f v (l :: [*]) r where
- hFoldr :: HFoldr f v l r => f -> v -> HList l -> r
- class HFoldl f (z :: *) xs (r :: *) where
- hFoldl :: HFoldl f z xs r => f -> z -> HList xs -> r
- class HReverse xs sx | xs -> sx, sx -> xs where
Documentation
data family HList (l :: [*]) Source #
Heterogeneous list
(Eq x, Eq (HList xs)) => Eq (HList ((:) * x xs)) Source # | |
Eq (HList ([] *)) Source # | |
(Ord x, Ord (HList xs)) => Ord (HList ((:) * x xs)) Source # | |
Ord (HList ([] *)) Source # | |
(Show e, Show (HList l)) => Show (HList ((:) * e l)) Source # | |
Show (HList ([] *)) Source # | |
data HList ([] *) Source # | |
data HList ((:) * x xs) Source # | |
class HFoldr' f v (l :: [*]) r where Source #
Like HFoldr but only use types, not values!
It allows us to foldr over a list of types, without any associated hlist of values.
class HFoldl' f (z :: *) xs (r :: *) where Source #
Like HFoldl but only use types, not values!
It allows us to foldr over a list of types, without any associated hlist of values.
class HTuple' v t | v -> t, t -> v where Source #
Convert between hlists and tuples
hToTuple' :: HList v -> t Source #
Convert an heterogeneous list into a tuple
hFromTuple' :: t -> HList v Source #
Convert a tuple into an heterogeneous list
HTuple' ([] *) () Source # | |
HTuple' ((:) * a ([] *)) (Single a) Source # | |
HTuple' ((:) * a ((:) * b ([] *))) (a, b) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ([] *)))) (a, b, c) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ([] *))))) (a, b, c, d) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ((:) * e ([] *)))))) (a, b, c, d, e) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ((:) * e ((:) * f ([] *))))))) (a, b, c, d, e, f) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ((:) * e ((:) * f ((:) * g ([] *)))))))) (a, b, c, d, e, f, g) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ((:) * e ((:) * f ((:) * g ((:) * h ([] *))))))))) (a, b, c, d, e, f, g, h) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ((:) * e ((:) * f ((:) * g ((:) * h ((:) * i ([] *)))))))))) (a, b, c, d, e, f, g, h, i) Source # | |
HTuple' ((:) * a ((:) * b ((:) * c ((:) * d ((:) * e ((:) * f ((:) * g ((:) * h ((:) * i ((:) * j ([] *))))))))))) (a, b, c, d, e, f, g, h, i, j) Source # | |
class Apply f a b where Source #
Apply the function identified by the data type f from type a to type b.