[Haskell-beginners] general observation about programming
jeffbrown.the at gmail.com
Mon Feb 29 00:51:48 UTC 2016
That will work in the special case of lists, but there are all sorts of
other things you might want to map across.
On Sat, Feb 27, 2016 at 7:24 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> On Sun, Feb 28, 2016 at 2:26 AM, Jeffrey Brown <jeffbrown.the at gmail.com>
>> It is, I agree, not appropriate everywhere, but point-free code can in
>> the right place be much more readable. Maps are a good example. Compare:
>> map (f . g . h) xs
>> map (\x -> f $ g $ h x) xs
> Not quite a fair comparison
> How about?
> [ f (g (h x)) | x <- xs ]
> Beginners mailing list
> Beginners at haskell.org
Jeffrey Benjamin Brown
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners