@@ -21,13 +21,17 @@ interface Applicative m => Monad (m : Type -> Type) where
2121
2222 -- default implementations
2323 (>>=) x f = join (f <$> x)
24− join x = x >>= (\y => y)
24+ join x = x >>= id
2525
2626||| For compatibility with Haskell. Note that monads are **not** free to
2727||| define `return` and `pure` differently!
2828return : Monad m => a -> m a
2929return = pure
3030
31+flatten : Monad m => m (m a) -> m a
32+flatten = join
33+%deprecate flatten "Please use `join`, which is the standard name."
34+
3135-- Annoyingly, these need to be here, so that we can use them in other
3236-- Prelude modules other than the top level.
3337