[Haskell-beginners] Why does this list comprehension return an empty list?
Kim-Ee Yeoh
ky3 at atamo.com
Wed Jul 24 02:52:14 CEST 2013
On Wed, Jul 24, 2013 at 7:47 AM, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
> Try: [(a,b) | a <- f xs | b <- g xs]
>
Oops, that'll only work if you define g xs = [[]], not []. So yes, you've
basically got a zip.
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130724/f417f670/attachment.htm>
More information about the Beginners
mailing list