summaryrefslogtreecommitdiff
path: root/libraries/base/Prelude.hs
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-03-07 11:10:34 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2015-03-07 11:10:53 +0100
commiteb3661f2b9f8472f3714774126ebe1183484dd85 (patch)
tree2153640f3a87a099ea1bcd399f327fb8600c7ebc /libraries/base/Prelude.hs
parent1965202febe27949a027dea90c0f0040fd9236e7 (diff)
downloadhaskell-eb3661f2b9f8472f3714774126ebe1183484dd85.tar.gz
Re-export `<$>` from Prelude (#10113)
Whether to re-export the `<$>` non-method operator from `Prelude` wasn't explicitly covered in the original AMP proposal[1], but it turns out that not doing so forces most code that makes use of applicatives to import `Data.Functor` or `Control.Applicative` just to get that operator into scope. To this end, it was proposed to add `<$>` to Prelude as well[2]. The down-side is that this increases the amount of redundant-import warnings triggered, as well as the relatively minor issue of stealing the `<$>` operator from the default namespace for good (although at this point `<$>` is supposed to be ubiquitous anyway due to `Applicative` being implicitly required into the next Haskell Report) [1]: https://wiki.haskell.org/Functor-Applicative-Monad_Proposal [2]: http://thread.gmane.org/gmane.comp.lang.haskell.libraries/24161 Reviewed By: austin, ekmett Differential Revision: https://phabricator.haskell.org/D680
Diffstat (limited to 'libraries/base/Prelude.hs')
-rw-r--r--libraries/base/Prelude.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/base/Prelude.hs b/libraries/base/Prelude.hs
index d1dc1a442a..8e275aa77f 100644
--- a/libraries/base/Prelude.hs
+++ b/libraries/base/Prelude.hs
@@ -70,7 +70,7 @@ module Prelude (
Monoid(mempty, mappend, mconcat),
-- ** Monads and functors
- Functor(fmap),
+ Functor(fmap), (<$>),
Applicative(pure, (<*>), (*>), (<*)),
Monad((>>=), (>>), return, fail),
mapM_, sequence_, (=<<),
@@ -158,6 +158,7 @@ import System.IO.Error
import Data.List
import Data.Either
import Data.Foldable ( Foldable(..) )
+import Data.Functor ( (<$>) )
import Data.Maybe
import Data.Traversable ( Traversable(..) )
import Data.Tuple