[Haskell-cafe] Pattern matching error

Brent Yorgey byorgey at gmail.com
Thu Dec 6 12:50:20 EST 2007


> kmerge ((x,[y]):[]) = [(x,[y])]
>

Matching on [y] like this will only match lists with a single element (and
bind y to that element).  You probably just want to say

kmerge ((x,y):[]) = [(x,y)]

etc., which will bind y to the entire list.

-Brent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071206/f89ede7a/attachment.htm


More information about the Haskell-Cafe mailing list