Historical question about type of Data.List.group

Jim Apple jbapple+haskell-lib at gmail.com
Tue Aug 26 15:45:26 EDT 2008


Why isn't the type of group

Eq a => [a] -> [(a,[a])]

That matches more exactly what group does, and it's easy to see that
functions like

nubOrd = map fst . group . sort

are clearly safe, whereas

map head . group . sort

is not.

Jim


More information about the Libraries mailing list