[Haskell-cafe] list comprehension doesn't work

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Tue May 14 18:43:29 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 14/05/13 16:59, John wrote:
> is'nt it possible, to write it in one line without any nested
> functions in WHERE? If it's possible I'd prefer that...
> 
> any idea?
> 
> Thanks
> 
> 
> 
> -- View this message in context:
> http://haskell.1045720.n5.nabble.com/list-comprehension-doesn-t-work-tp5730158p5730170.html
>
> 
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> 
> _______________________________________________ Haskell-Cafe
> mailing list Haskell-Cafe at haskell.org 
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
I'm sorry but you should at least attempt a solution yourself and ask
for help if you get stuck. Furthermore, this topic is a bit more
appropriate on the Haskell beginners mailing list. You should also
probably read a bit more about the language before asking about the
very basics (such as the `||' operator).

You can define any non-recursive functions inline with lambda
functions. There really is no reason to avoid `where' just for the
sake of having it inline though. It's bad practice to have very long
lines and it's horrible for readability.

- -- 
Mateusz K.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQIcBAEBAgAGBQJRkmmxAAoJEM1mucMq2pqXjh0P/j2OlvpSfggL3z9qkQEscTK/
BrDCLGTE4YaEm1BRSIt7HOPZUebZdrKUkulVAE2E2W59qSnW7kDtAKuAa7sEz/BG
gvnwrJynMmCRJiZfHUfiO1OCdmbyXomzJxG3exwW1ovLrd1bk8uFO9Kc7Eyrr1n0
moTvtAVbYuPYz0WooJOHES2uaW8tdJgJVCh+q0Fv0hPrQIGFCx038C2TmGHrTHzE
1c/0c36L6uOiHGMWNz32Qpkxg9a0f9NENv6jJGUryP27cpqG+whZ4TeAWYr+57lS
x40XC6s5+WY1eLHCxBMNCQGf9/JwDwcXosOtiz9kpnggee7ck7DjK2K2wRT/mUVv
fRHmUyUM9i5RxJABrXy0vwgRhnDGfHHwB5w2JAvpTxUDCvffavgZnqnbKyo5R4NQ
inxf4u5luRZtcCVVBNVUznvraddK8GJkVVMrCuSb2SqXHO34MrFIMkUzx20Ba/nH
fmO8nvjVym92+gOSuX9OWQHzSDEmkrmNmeWSKwIxa1W6VMebir4thMygSM6Y5QZg
hr+Op1aICBJEUelgQltB30shAY+Pvnn7Q9C45JICLq850W5KHvCRd/sC2+5pCzgR
iOFGULTW5fKX0M2OsumJoCU2t9JbNxbbxlfSyEHcPB3Z/8PO2VWQPd9a03J1eDiN
yKoDgIncc/HRqmLgObxG
=plBj
-----END PGP SIGNATURE-----



More information about the Haskell-Cafe mailing list