I was trying out some of the examples in the A Fistful of Monads chapter of Learn you a Haskell, and some returned errors when I ran them in GHCi 7.6.3:
Prelude> Just (+3) <*> Just 3
<interactive>:2:11: Not in scope: `<*>'
I get a similar error when using <$>
.
These operators are from Control.Applicative
. You need to import Control.Applicative
or say :m +Control.Applicative
in ghci
. You can find out where many standard operators come from using Hoogle.
As of GHC 7.10, with the Functor-Applicative-Monad Proposal implemented in base
4.8, <*>
is now present in the Prelude and does not require an import.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With