more flexible partial application
John Hughes
rjmh at cs.chalmers.se
Thu Jan 26 04:08:27 EST 2006
>On 1/23/06, Sebastian Sylvan <sebastian.sylvan at gmail.com> wrote:
>
>
>>Are there any subtle reasons for why something like the following
>>couldn't be allowed?
>>
>>
>>
>>
>>>foo x y z w = ...
>>>bar x w = foo x _ _ w
>>>
>>>
>>I.e. a more flexible version of partial application. This would be
>>translated too
>>
>>
>>
>>>bar x w = \y z -> foo x y z w
>>>
>>>
>>I.e a function which takes the "_" parameters in the same order they
>>were encountered in the function application.
>>
>>
>>
I'd be against this--its semantics isn't clear enough to me. For example,
I usually assume id e = e, for any e, but
id (f _ x) y = id (\y->f y x) y = f y x
/=
f _ x y = \z -> f z x y
Or would (f _ x) y and f _ x y maybe be different? That would fix the
problem above, while introducing another. Please, no!
John
More information about the Haskell-prime
mailing list