summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2021-09-03 22:12:47 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-06 22:58:32 -0400
commit89820293c0559dc744704d0bf3370a035adb17ea (patch)
tree4f5e08a103ed6c6281da6d02501cd0f17b7120f8
parent407d3b3a3a219dab56d0a36598c637aa45da61e1 (diff)
downloadhaskell-89820293c0559dc744704d0bf3370a035adb17ea.tar.gz
Define returnA = id
-rw-r--r--libraries/base/Control/Arrow.hs2
-rw-r--r--libraries/base/changelog.md2
-rw-r--r--testsuite/tests/simplCore/should_compile/T18013.stderr6
3 files changed, 7 insertions, 3 deletions
diff --git a/libraries/base/Control/Arrow.hs b/libraries/base/Control/Arrow.hs
index eec25a3179..d446013f9a 100644
--- a/libraries/base/Control/Arrow.hs
+++ b/libraries/base/Control/Arrow.hs
@@ -205,7 +205,7 @@ instance Monad m => Arrow (Kleisli m) where
-- | The identity arrow, which plays the role of 'return' in arrow notation.
returnA :: Arrow a => a b b
-returnA = arr id
+returnA = id
-- | Precomposition with a pure function.
(^>>) :: Arrow a => (b -> c) -> a c d -> a b d
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index b71a1fd787..0ce3960092 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -16,6 +16,8 @@
* `fromEnum` for `Natural` now throws an error for any number that cannot be
repesented exactly by an `Int` (#20291).
+ * `returnA` is defined as `Control.Category.id` instead of `arr id`.
+
## 4.16.0.0 *TBA*
* Add a `Typeable` constraint to `fromStaticPtr` in the class `GHC.StaticPtr.IsStatic`.
diff --git a/testsuite/tests/simplCore/should_compile/T18013.stderr b/testsuite/tests/simplCore/should_compile/T18013.stderr
index 5c82b03c93..5fe7eec578 100644
--- a/testsuite/tests/simplCore/should_compile/T18013.stderr
+++ b/testsuite/tests/simplCore/should_compile/T18013.stderr
@@ -5,7 +5,8 @@ Rule fired: Class op $p1Arrow (BUILTIN)
Rule fired: Class op $p1Arrow (BUILTIN)
Rule fired: Class op $p1Arrow (BUILTIN)
Rule fired: Class op $p1Arrow (BUILTIN)
-Rule fired: Class op arr (BUILTIN)
+Rule fired: Class op $p1Arrow (BUILTIN)
+Rule fired: Class op id (BUILTIN)
Rule fired: Class op $p1Monad (BUILTIN)
Rule fired: Class op pure (BUILTIN)
Rule fired: Class op $p1Monad (BUILTIN)
@@ -70,7 +71,8 @@ Rule fired: Class op >>= (BUILTIN)
Rule fired: Class op >>= (BUILTIN)
Rule fired: Class op pure (BUILTIN)
Rule fired: Class op $p1Arrow (BUILTIN)
-Rule fired: Class op arr (BUILTIN)
+Rule fired: Class op $p1Arrow (BUILTIN)
+Rule fired: Class op id (BUILTIN)
Rule fired: Class op $p1Monad (BUILTIN)
Rule fired: Class op pure (BUILTIN)
Rule fired: Class op $p1Monad (BUILTIN)