X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FArrow.hs;h=55e004d29eba089373f19f1ea79de774e751e6ae;hb=b99920eab7fba4e027fd39985840d4e854b8f923;hp=d873bd836a89755404554338ebe16c1a9a0f34d5;hpb=cea1e4133bcc2069e17144fc7bc2b0c01e7357f1;p=ghc-base.git diff --git a/Control/Arrow.hs b/Control/Arrow.hs index d873bd8..55e004d 100644 --- a/Control/Arrow.hs +++ b/Control/Arrow.hs @@ -39,7 +39,6 @@ module Control.Arrow ( ) where import Prelude hiding (id,(.)) -import qualified Prelude (id) import Control.Monad import Control.Monad.Fix @@ -75,7 +74,8 @@ class Category a => Arrow a where -- version if desired. second :: a b c -> a (d,b) (d,c) second f = arr swap >>> first f >>> arr swap - where swap ~(x,y) = (y,x) + where swap :: (x,y) -> (y,x) + swap ~(x,y) = (y,x) -- | Split the input between the two argument arrows and combine -- their output. Note that this is in general not a functor. @@ -183,7 +183,8 @@ class Arrow a => ArrowChoice a where -- version if desired. right :: a b c -> a (Either d b) (Either d c) right f = arr mirror >>> left f >>> arr mirror - where mirror (Left x) = Right x + where mirror :: Either x y -> Either y x + mirror (Left x) = Right x mirror (Right y) = Left y -- | Split the input between the two argument arrows, retagging