[Haskell-beginners] Simpler than lifting

Brandon Allbery allbery.b at gmail.com
Mon Mar 18 15:15:53 CET 2013

On Mon, Mar 18, 2013 at 9:59 AM, Adrian May
<adrian.alexander.may at gmail.com>wrote:

> infixl 6 ~+, ~-
> f ~+ g = \p -> f p + g p
> f ~- g = \p -> f p - g p
> but I feel that the prelude must have already taken care of such things.
> What's the proper way to do it?

Not in the Prelude (which is specified by the Haskell Language Report and
difficult to change), but I think you want to look at Control.Applicative.

brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130318/0917a8c0/attachment.htm>

More information about the Beginners mailing list