Creighton Hogg <[EMAIL PROTECTED]> writes:

> data Patootie = Pa Int | Tootie Int
> and I want to pull out the indices of all elements of a list 
> that have type constructor Tootie, how would I do that?

x = [Pa 3, Tootie 5, Pa 7, Tootie 9, Pa 11]
y = [ i |    Tootie i  <- x ]
z = [ i | i@(Tootie _) <- x ]

y or z might be helpful.

-- Mark

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to