[Haskell-cafe] Use unsafePerformIO to catch Exception?

Ketil Malde ketil at malde.org
Sat Mar 28 04:41:16 EDT 2009

Duncan Coutts <duncan.coutts at worc.ox.ac.uk> writes:

> Yes, grouping is the one where I most often find the need for head or
> partial patterns. The function group produces a list of non-empty lists
> but that is not reflected in the type. On the other hand, actually
> reflecting it in the type would make it more awkward:
> group :: Eq a => [a] -> [(a,[a])]

  group :: Eq a => [a] -> [(a,Int)] ?

This is often what I want anyway :-)  Of course, this only works for
sane Eq instances.

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list