Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/914703ab7bfa273b81649807d06189cbc01838ab

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

commit 914703ab7bfa273b81649807d06189cbc01838ab
Author: Ross Paterson <[email protected]>
Date:   Tue Oct 25 16:47:46 2011 +0100

    Warn about ArrowLoop instance for Kleisli Arrows
    
    Suggested by Heinrich Apfelmus on the libraries list.

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

 Control/Arrow.hs |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Control/Arrow.hs b/Control/Arrow.hs
index 012a75a..578c457 100644
--- a/Control/Arrow.hs
+++ b/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)



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to