summaryrefslogtreecommitdiff
path: root/Utility/Monad.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-02 14:54:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-03 00:11:00 -0400
commitfc80b8d96bf287a0b83c1402e3a7c5ebfc7bc4a4 (patch)
tree344c45f3bf1cd263e80bbb456700574b95ba90fd /Utility/Monad.hs
parent5cd44282a92dd6fa7eacc62858c8b8e553590195 (diff)
factor observe_
Diffstat (limited to 'Utility/Monad.hs')
-rw-r--r--Utility/Monad.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utility/Monad.hs b/Utility/Monad.hs
index 9e2a16e8c..7f9c7b1bc 100644
--- a/Utility/Monad.hs
+++ b/Utility/Monad.hs
@@ -36,3 +36,7 @@ observe observer a = do
r <- a
_ <- observer r
return r
+
+{- Like observe, but the observer is not passed the value. -}
+observe_ :: (Monad m) => m b -> m a -> m a
+observe_ observer = observe (const observer)