[Haskell-cafe] Question about HList possibilities

Scott West saynte at gmail.com
Mon Jun 25 10:39:47 EDT 2007

Hello all,

Given an HList (http://homepages.cwi.nl/~ralf/HList/) would it be
possible to do the following:

Create a class/function/magicks that would essentially do what
hOccursMany does, except it would not return a list of elements, but a
new HList. For example, would this allow us to be able to write more
lax typing constraints and say extract only things that are in lists.

ie) HCons "hi"  (HCons [2.2,3.3] (HCons 'a' hNil)) -> HCons "hi"
(HCons [2.2,3.3]  hNil)

(removing the Char element).

I tried to write something like this but I did not get very far, is it
even possible? I'm new to this type-level programming :)


More information about the Haskell-Cafe mailing list