diff options
author | Georgi Lyubenov <georgi.lyubenov@tweag.io> | 2022-06-14 13:06:38 +0300 |
---|---|---|
committer | Georgi Lyubenov <georgi.lyubenov@tweag.io> | 2022-09-08 17:14:36 +0300 |
commit | 77209ab32aee6f58504b303fdea2df69f5a71027 (patch) | |
tree | 4115353be46d258f8b4245072dc84ce06c18f289 /libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs | |
parent | 7918265d53db963bfd3dd529b1063fb844549733 (diff) | |
download | haskell-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 'libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs b/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs index 5d2a32d761..e95a449e1d 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs @@ -20,12 +20,12 @@ module Language.Haskell.TH.Lib.Internal where import Language.Haskell.TH.Syntax hiding (Role, InjectivityAnn) import qualified Language.Haskell.TH.Syntax as TH -import Control.Applicative(liftA, liftA2) +import Control.Applicative(liftA, Applicative(..)) import qualified Data.Kind as Kind (Type) import Data.Word( Word8 ) import Data.List.NonEmpty ( NonEmpty(..) ) import GHC.Exts (TYPE) -import Prelude +import Prelude hiding (Applicative(..)) ---------------------------------------------------------- -- * Type synonyms |