summaryrefslogtreecommitdiff
path: root/libraries/base/Control/Arrow.hs
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-10-08 16:34:17 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2015-10-10 15:10:29 +0200
commitdb60084d738621b13835af2444bdf8c50013bf65 (patch)
tree431850660b8bb1472c4ca43c3407c446101bd37d /libraries/base/Control/Arrow.hs
parentf64f7c36ef9395da1cc7b686aaf1b019204cd0fc (diff)
downloadhaskell-db60084d738621b13835af2444bdf8c50013bf65.tar.gz
base: MRP-refactoring of AMP instanceswip/D1316
Summary: This refactors (>>)/(*>)/return/pure methods into normalform. The redundant explicit `return` method definitions are dropped altogether. This results in measurable runtime improvements in nofib of up to -20% runtime (geometric mean: -7%) in my measurements. Reviewers: quchen, austin, alanz, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1316
Diffstat (limited to 'libraries/base/Control/Arrow.hs')
-rw-r--r--libraries/base/Control/Arrow.hs1
1 files changed, 0 insertions, 1 deletions
diff --git a/libraries/base/Control/Arrow.hs b/libraries/base/Control/Arrow.hs
index 9d09544eeb..c9281569f9 100644
--- a/libraries/base/Control/Arrow.hs
+++ b/libraries/base/Control/Arrow.hs
@@ -314,7 +314,6 @@ instance Arrow a => Applicative (ArrowMonad a) where
ArrowMonad f <*> ArrowMonad x = ArrowMonad (f &&& x >>> arr (uncurry id))
instance ArrowApply a => Monad (ArrowMonad a) where
- return x = ArrowMonad (arr (\_ -> x))
ArrowMonad m >>= f = ArrowMonad $
m >>> arr (\x -> let ArrowMonad h = f x in (h, ())) >>> app