diff options
author | Ross Paterson <ross@soi.city.ac.uk> | 2011-10-25 16:47:46 +0100 |
---|---|---|
committer | Ross Paterson <ross@soi.city.ac.uk> | 2011-10-25 16:47:46 +0100 |
commit | cd6a715806f64b5ccb0cbcfb7ea00a19d4fff978 (patch) | |
tree | 89fcf0f772c858cc4a162ac4ddaa89dc819150dc | |
parent | ac3ddf2b3bcf586f626566d2eb30f03c561d6d7a (diff) | |
download | haskell-cd6a715806f64b5ccb0cbcfb7ea00a19d4fff978.tar.gz |
Warn about ArrowLoop instance for Kleisli Arrows
Suggested by Heinrich Apfelmus on the libraries list.
-rw-r--r-- | libraries/base/Control/Arrow.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/base/Control/Arrow.hs b/libraries/base/Control/Arrow.hs index 012a75a6fe..578c45778a 100644 --- a/libraries/base/Control/Arrow.hs +++ b/libraries/base/Control/Arrow.hs @@ -274,6 +274,9 @@ class Arrow a => ArrowLoop a where instance ArrowLoop (->) where loop f b = let (c,d) = f (b,d) in c +-- | Beware that for many monads (those for which the '>>=' operation +-- is strict) this instance will /not/ satisfy the right-tightening law +-- required by the 'ArrowLoop' class. instance MonadFix m => ArrowLoop (Kleisli m) where loop (Kleisli f) = Kleisli (liftM fst . mfix . f') where f' x y = f (x, snd y) |