... | ... | @@ -69,14 +69,6 @@ instance Monad Foo where |
|
|
{- ...retain other previous definitions... -}
|
|
|
```
|
|
|
|
|
|
instance Monad Foo where
|
|
|
return = pure {- definition moved to `Applicative(pure)` -}
|
|
|
|
|
|
(>>) = (*>) {- definition moved to `Applicative((*>))` -}
|
|
|
|
|
|
{- ...retain other previous definitions... -}
|
|
|
```
|
|
|
|
|
|
Starting with GHC 7.10, defining `Monad(return)` is optional (with the default implementation `return = pure`). For code not required to be compatible with GHC versions prior to GHC 7.10 it's recommended to omit the explicit `return` definition.
|
|
|
|
|
|
|
... | ... | @@ -125,10 +117,6 @@ main :: IO () |
|
|
main = print ('I' `elem` "team")
|
|
|
```
|
|
|
|
|
|
main :: IO ()
|
|
|
main = print ('I' `elem` "team")
|
|
|
```
|
|
|
|
|
|
will let GHC spit out the intimidating complaint that
|
|
|
|
|
|
```
|
... | ... | @@ -170,11 +158,6 @@ import Data.Word |
|
|
-- import Prelude
|
|
|
```
|
|
|
|
|
|
import Data.Monoid
|
|
|
import Data.Word
|
|
|
-- import Prelude
|
|
|
```
|
|
|
|
|
|
will result in two redundant import warnings with GHC 7.10.1 (under `-Wall`):
|
|
|
|
|
|
```
|
... | ... | |