This function is already in the HList library (well early versions
anyway)... I dont think
this is in the current distribution. Its a generic constructor
wrapper. For example:
hMarkAll Just hlist
class HList l = HMarkAll c l m | c l - m where
hMarkAll :: (forall a . a - c a) -
Keean,
I sort of gave up on HList for the time being since I found easier
ways to solve my problem.
Mainly, I could not estimate the impact it would have on run-time
performance of my code and GHC not being able to compile the code was
not a good indication. Simon PJ fixed that error
That all depends... In theory all the HList stuff happens at compile
time, and what you are left with is normal function application... Of
course compilers arn't that good yet, but as a reasonable idea, consider
just that value level... Most of the extra work is the packing/unpacking
of pairs
Credit goes to Cale:
class (HList l, HList p) = HLPU p l | p - l, l - p where
puHList :: p - PU l
instance HLPU HNil HNil where
puHList HNil = lift HNil
instance (HList l, HLPU p l) = HLPU (HCons (PU e) p) (HCons e l) where
puHList (HCons pe l) =
wrap (\(a, b) - HCons a b,