[Haskell-beginners] The Applicative instance for ((->) a)

Tony Morris tonymorris at gmail.com
Sat Jul 11 07:54:32 EDT 2009


Here are a couple of examples

> (+) <$> Just 7 <*> Just 8
Just 15

> (*) <$> [1, 2, 3] <*> [4, 5, 6]
[4,5,6,8,10,12,12,15,18]


Ian Duncan wrote:
> Hey folks, I understand most of what is going on with the applicative
> class, but I can't figure out why this instance is useful:
> "instance Applicative ((->) a) where..."
>
> Can anyone offer some intuition into how this is could be used?
>
> Ian Duncan
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>

-- 
Tony Morris
http://tmorris.net/




More information about the Beginners mailing list