[Haskell-cafe] Rewrite without parenthesis

Francesco Ariis fa-ml at ariis.it
Thu Aug 18 12:28:08 UTC 2016


On Thu, Aug 18, 2016 at 05:29:34AM -0700, Theodore Lief Gannon wrote:
> Francesco, you missed a piece. 'head' is part of the expression. :) What
> Carl is looking for is one or the other of these:
> 
> head $ tail [1,2,3]
> -- or --
> head . tail $ [1,2,3]
> 
> The first one is shorter and fine for inlining, but I generally prefer the
> second form... it helps intuition about eta reduction, refactoring, and
> additional composition.

Welp, silly me! :P


More information about the Haskell-Cafe mailing list