[Haskell-beginners] \x -> x < 0.5 && x > -0.5
Luca Ciciriello
luca_ciciriello at hotmail.com
Mon Oct 19 05:22:26 EDT 2009
Had you considered list comprehension?
[x | x <- xs, x < 0.5 && x > -0.5]
Luca.
> Date: Mon, 19 Oct 2009 01:49:17 -0700
> From: mpm at alumni.caltech.edu
> To: beginners at haskell.org
> Subject: [Haskell-beginners] \x -> x < 0.5 && x > -0.5
>
> Is there a nifty way to write
>
> filter (\x -> x < 0.5 && x > -0.5) xs
>
> without explicitly using x?
>
> Maybe arrows? I have a vague understanding that arrows can "send" an
> argument to more than one computation.
>
> -Mike
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
_________________________________________________________________
Use Windows Live Messenger for free on selected mobiles
http://clk.atdmt.com/UKM/go/174426567/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20091019/09a310c4/attachment.html
More information about the Beginners
mailing list