[Haskell-beginners] general observation about programming

Rustom Mody rustompmody at gmail.com
Sat Feb 27 06:17:13 UTC 2016


On Fri, Feb 26, 2016 at 11:11 PM, Rein Henrichs <rein.henrichs at gmail.com>
wrote:

> Pointfree is good for reasoning about *composition*. It can often be more
> readable than pointful code when the focus of the function is on
> composition of other functions. For example, take this function from Bird's *Pearls
> of Functional Algorithm Design*:
>
>  boxes = map ungroup . ungroup . map cols . group . map group
>

And better if you read it in the right (ie left to right order)


boxes  =  map group >>> group >>> map cols >> ungroup >>> map ungroup
(From Control.Arrow)

Even better if the 3-char clunky >>> is reduced to the 1-char ⋙
map group ⋙ group ⋙ map cols ⋙ ungroup ⋙ map ungroup
(From Control.Arrow.Unicode)
[Those who find this unnatural/difficult/arcane/etc may like to check out
Unix-pipes (or English :-) ]

Some wishful thinking in the same direction
(uses python but python is not really relevant)  :
http://blog.languager.org/2014/04/unicoded-python.html
Which to some extent I found works in Haskell :
http://blog.languager.org/2014/05/unicode-in-haskell-source.html
If only Haskell would go further!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160227/c3290aa0/attachment.html>


More information about the Beginners mailing list