Jerzy pointed out the utility (well, at least the *possibility*) of expressions such as the following when writing points-free code (or perhaps per Matthew it should be "pointy code" :) ):

        (.) . (.) . (.)

This is the function which composes a 1-argument function with a 3-argument function (and the pattern generalizes to n in the second functional argument). I sometimes itch to use the n=2 case, as in the following, but good sense usually gets the better of me:

        (.<) = (.) . (.)

(this allows, for example, concat .< replicate).

One gets the impression of some odd kind of Morse code, or perhaps "smileys" / "emoticons" ...

The attached file gives some more detail and examples for the points-free fans.

  --  Fritz



Attachment: Comp.hs
Description: application/text

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to