[Haskell-cafe] Seeking advice on a style question

Steve Schafer steve at fenestra.com
Tue Dec 26 21:56:12 EST 2006


On Tue, 26 Dec 2006 18:29:43 +0000, you wrote:

>> -- process :: a -> b -> c -> d -> e
>> process x1 x2 x3 x4 = 
>>    let y01       = f01 x1 x2 x3
>>    in ($ x1) (f02 >>> f03 >>> f04 >>> f05 x1 y01 >>> f06 x2 >>> f07 y01
>>                   >>> first f08 >>> uncurry (f09 x2 x4)
>>                   >>> first (f10 >>> f11 >>> f12 x1 x2 x3 y01 >>> f13)
>>                   >>> uncurry f14)

This is like what I was looking for, although it does still require at
least one temporary variable. I'll have to think about it a bit to see
how applicable it is in general. Thanks.

The tuples do make things a bit messy; they could easily be removed at
the cost of introducing a few more steps:

 (y07,y08) = f07 y01 y06;

would become

 y'  = f07 y01 y06;
 y07 = f07a y';
 y08 = f07b y';

where f07a = fst and f07b = snd.

Steve Schafer
Fenestra Technologies Corp.
http://www.fenestra.com/


More information about the Haskell-Cafe mailing list