[Haskell-cafe] Re: Re-order type (flip map)
Ozgur Akgun
ozgurakgun at gmail.com
Sun Oct 10 18:51:20 EDT 2010
No, wrong. I am speaking nonsense here.
Of course one also needs to define a *forward* function composition operator
to get the effect you originally wanted.
My point was: you need to find/define two operators, not just one. That
still holds :)
Best,
On 10 October 2010 23:47, Ozgur Akgun <ozgurakgun at gmail.com> wrote:
>
> On 10 October 2010 22:32, Johannes Waldmann <waldmann at imn.htwk-leipzig.de>wrote:
>
>> Oh, and while we're at it - are there standard notations
>> for "forward" function composition and application?
>>
>> I mean instead of h . g . f $ x
>> I'd sometimes prefer x ? f ? g ? h
>> but what are the "?"
>>
>
> While asking you use the same symbol for function composition, and
> something like inverse function application. I don't think there exists an
> operator ?, such that h . g . f $ x is equivalent to x ? f ? g ? h.
>
> But you can simply define an inverse function application like the
> following and have a close enough alternative,
>
> ($$) :: a -> (a -> b) -> b
> ($$) = flip ($)
> infixl 5 $$
>
> Now the following two expression are identical, I suppose:
>
> h . g . f $ x
> x $$ f . g . h
>
> Cheers,
> Ozgur
>
--
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101010/c0c7a5cd/attachment.html
More information about the Haskell-Cafe
mailing list