[Haskell-beginners] general observation about programming
Jeffrey Brown
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>
> wrote:
>
>> 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
>>
>> to
>>
>> 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
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
--
Jeffrey Benjamin Brown
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160228/07d0ba45/attachment.html>
More information about the Beginners
mailing list