
14 Feb
2006
14 Feb
'06
6:59 p.m.
Jean-Philippe Bernardy wrote:
http://hackage.haskell.org/trac/ghc/wiki/CollectionClassFramework
I'm missing the equivalent of pattern matching the head of a list. The closest equivalent would be another method in class Collection: front :: c -> Maybe (o,c) Algorithms that pattern match on a list could be expressed in terms of 'front' instead of 'toList' and a match. In a sense, 'front' is to 'insert' as 'unfoldr' is to 'foldr', so it should be there as well, though possibly under a better name. Udo. -- What nonsense people talk about happy marriages! A man can be happy with any woman so long as he doesn't love her. -- Oscar Wilde