Peter Hercek wrote:
f = g . transform displacement . scale factor
or pointfully
f x = g (transform displacement (scale factor x))
with the appropriate combinators.

Essentially the same idea as the one from Brent Yorgey.
Works fine till the operations can fill easily on one line. Then it does not
 scale that well since when it needs to be on more lines it interferes with
automatic insertion of curly braces and semicolons by the layout rules (which are influenced by the context). Of course when there are more transformations
 it makes sense to name the intermediate results differently, but even few
 transformations may not fit easily when identifier names are long.


I have no idea what you're talking about. It works fine on multiple lines:

f x = g
      . transform displacement
      . scale factor
      $ x

is perfectly valid.

Tastes may vary, you might prefer trailing .s to leading .s, but the idea is the same.

Jules

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to