[commit: packages/deepseq] down, master, wip/remove_ghc70_72_cpp: Add strict liftM (#23) (e01ad84)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 21:59:17 UTC 2017


Repository : ssh://git@git.haskell.org/deepseq

On branches: down,master,wip/remove_ghc70_72_cpp
Link       : http://git.haskell.org/packages/deepseq.git/commitdiff/e01ad84372221ac0d7088c674344acec4b7deb1d

>---------------------------------------------------------------

commit e01ad84372221ac0d7088c674344acec4b7deb1d
Author: Oleg Grenrus <oleg.grenrus at iki.fi>
Date:   Thu Nov 17 16:39:14 2016 +0200

    Add strict liftM (#23)


>---------------------------------------------------------------

e01ad84372221ac0d7088c674344acec4b7deb1d
 Control/DeepSeq.hs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs
index 4d7e9e6..384a036 100644
--- a/Control/DeepSeq.hs
+++ b/Control/DeepSeq.hs
@@ -59,7 +59,7 @@
 --
 -- @since 1.1.0.0
 module Control.DeepSeq (
-     deepseq, ($!!), force,
+     deepseq, ($!!), force, (<$!!>),
      NFData(..),
   ) where
 
@@ -209,6 +209,13 @@ f $!! x = x `deepseq` f x
 force :: (NFData a) => a -> a
 force x = x `deepseq` x
 
+-- | Deeply strict version of 'Control.Applicative.<$>'.
+--
+-- @since 1.4.3.0
+(<$!!>) :: (Monad m, NFData b) => (a -> b) -> m a -> m b
+f <$!!> m = m >>= \x -> return $!! f x
+infixl 4 <$!!>
+
 -- | A class of types that can be fully evaluated.
 --
 -- @since 1.1.0.0



More information about the ghc-commits mailing list