[Haskell-beginners] Lifting infix functions in applicative style

Bastian Erdnüß earthnut at web.de
Sat Nov 6 08:55:14 EDT 2010

On Nov 6, 2010, at 11:22, Brent Yorgey wrote:

> On Sat, Nov 06, 2010 at 01:33:39AM +0100, Bastian Erdnüß wrote:
>> When I want to lift an infix function into an applicative functor I use 'liftA2' -- I just call it 'up' for the sake of brevity.  But I always have to add some parenthesis since I don't know how to tell Haskel that `up op` shall have the same fixity as `op` has.  Is there a way to do that?
> No, there isn't.  Also, `up op` is not valid syntax -- only names may
> go in between `backticks`, not expressions in general.

Really not?  Ouh, probably I should try to test compile my source a little bit more often.

> You may be interested in the InfixApplicative package:
>  http://hackage.haskell.org/package/InfixApplicative
> although it still doesn't solve the problem of fixity.

I am, thanks.  At least it solves my problem the way I thought I would have solved it already ;-)

> -Brent

Thanks for your respond.

More information about the Beginners mailing list