Importing Control.Monad
should give you ap
. However, in all but the most recent versions of GHC (7.6.1 and newer), you'll also need to import Control.Monad.Instances
to use the monad instance for functions.
Alternatively, you can import Control.Applicative
which gives you the <*>
operator, which is ap
generalized to Applicative
, as well as the necessary instances to use it with functions.