[Haskell-cafe] Re: let and fixed point operator

Jules Bean jules at jellybean.co.uk
Mon Sep 3 09:03:25 EDT 2007

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.


More information about the Haskell-Cafe mailing list