FAQ Database Discussion Community

Fold over a heterogeneous, compile time, list

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?

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...