Re: [Haskell-cafe] simple Haskell question - List comprehensions

2008-03-12 Thread Philip Müller
Dan Licata schrieb: Does that help? Yeah, it did - Thanks! - Philip ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] simple Haskell question - List comprehensions

2008-03-09 Thread Sebastian Sylvan
On Sun, Mar 9, 2008 at 7:27 PM, Philip Müller <[EMAIL PROTECTED]> wrote: > Hi, > > I'm just working through Hutton's "Programming in Haskell" and I found > an exercise which I can't solve, although it looks simple. Maybe someone > here could give me a hint? > > Exercise: > Show how the single comp

Re: [Haskell-cafe] simple Haskell question - List comprehensions

2008-03-09 Thread Miguel Mitrofanov
Exercise: Show how the single comprehension [(x,y) | x <- [1,2,3], y <- [4,5,6]] with two generators can be re-expressed using two comprehensions with single generators. Hint: make use of the library function _concat_. Another hint: it can be rewritten as concatMap (\x -> concatMap (\y ->

[Haskell-cafe] simple Haskell question - List comprehensions

2008-03-09 Thread Philip Müller
Hi, I'm just working through Hutton's "Programming in Haskell" and I found an exercise which I can't solve, although it looks simple. Maybe someone here could give me a hint? Exercise: Show how the single comprehension [(x,y) | x <- [1,2,3], y <- [4,5,6]] with two generators can be re-expres