FAQ Database Discussion Community


Fold over a heterogeneous, compile time, list

haskell,type-level-computation,hlist
I have a list of heterogeneous types (or at least that's what I have in mind): data Nul data Bits b otherBits where BitsLst :: b -> otherBits -> Bits b otherBits NoMoreBits :: Bits b Nul Now, given an input type b, I want to go through all the...

Can HListElim be composed with another function?

haskell,type-level-computation,hlist
Given {-# LANGUAGE TypeFamilies, KindSignatures #-} {-# LANGUAGE GADTs, DataKinds, TypeOperators #-} import Data.HList import Data.Singletons import Data.Singletons.Prelude.List type family HListElim (ts :: [*]) (a :: *) :: * where HListElim '[] a = a HListElim (t ': ts) a = t -> HListElim ts a hListUncurry :: HListElim ts...