summaryrefslogtreecommitdiff
path: root/compiler/GHC/Utils/Monad.hs
diff options
context:
space:
mode:
authorGeorgi Lyubenov <georgi.lyubenov@tweag.io>2022-06-14 13:06:38 +0300
committerGeorgi Lyubenov <georgi.lyubenov@tweag.io>2022-09-08 17:14:36 +0300
commit77209ab32aee6f58504b303fdea2df69f5a71027 (patch)
tree4115353be46d258f8b4245072dc84ce06c18f289 /compiler/GHC/Utils/Monad.hs
parent7918265d53db963bfd3dd529b1063fb844549733 (diff)
downloadhaskell-77209ab32aee6f58504b303fdea2df69f5a71027.tar.gz
Export liftA2 from Prelude
Changes: In order to be warning free and compatible, we hide Applicative(..) from Prelude in a few places and instead import it directly from Control.Applicative. Please see the migration guide at https://github.com/haskell/core-libraries-committee/blob/main/guides/export-lifta2-prelude.md for more details. This means that Applicative is now exported in its entirety from Prelude. Motivation: This change is motivated by a few things: * liftA2 is an often used function, even more so than (<*>) for some people. * When implementing Applicative, the compiler will prompt you for either an implementation of (<*>) or of liftA2, but trying to use the latter ends with an error, without further imports. This could be confusing for newbies. * For teaching, it is often times easier to introduce liftA2 first, as it is a natural generalisation of fmap. * This change seems to have been unanimously and enthusiastically accepted by the CLC members, possibly indicating a lot of love for it. * This change causes very limited breakage, see the linked issue below for an investigation on this. See https://github.com/haskell/core-libraries-committee/issues/50 for the surrounding discussion and more details.
Diffstat (limited to 'compiler/GHC/Utils/Monad.hs')
-rw-r--r--compiler/GHC/Utils/Monad.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Utils/Monad.hs b/compiler/GHC/Utils/Monad.hs
index 3bf8737990..f9fc02b338 100644
--- a/compiler/GHC/Utils/Monad.hs
+++ b/compiler/GHC/Utils/Monad.hs
@@ -27,7 +27,7 @@ module GHC.Utils.Monad
-- Imports
-------------------------------------------------------------------------------
-import GHC.Prelude
+import GHC.Prelude hiding (Applicative(..))
import Control.Applicative
import Control.Monad