import Monad class Applicable a b c | a b -> c where apply :: a -> b -> c instance Applicable a (a -> b) b where apply x f = f x instance Applicable (a -> b) a b where apply f x = f x instance (Monad m, Applicable a b c) => Applicable (m a) (m b) (m c) where apply = liftM2 apply int :: Int -> Int int = id plus :: Int -> Int -> Int plus = (+) --test = apply [int 3] (apply [plus] [int 5])