Make Applicative a superclass of Monad
Make Applicative (in Control.Applicative) a superclass of Monad (in Control.Monad). Rename members of Applicative and other functions, to avoid unnecessary duplication.
class Functor f => Applicative f where
return :: a -> f a
ap :: f (a -> b) -> f a -> f b
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
liftA2 f a b = ap (fmap f a) b
(>>) :: (Applicative f) => f a -> f b -> f b
(>>) = liftA2 (const id)
-- etc.
class Applicative m => Monad m where
(>>=) :: forall a b . m a -> (a -> m b) -> m b
fail :: String -> m a
fail s = error s
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.8.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown |
| Architecture | Unknown |