RFC: Collection framework.
Udo Stenzel
u.stenzel at web.de
Tue Feb 14 13:59:03 EST 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/libraries/attachments/20060214/50bf16d0/attachment.bin
More information about the Libraries
mailing list