Skip to content
Browse files

Changed precedence for when and orElse.

  • Loading branch information...
1 parent 764fc42 commit ced6f7d22fe721e663d276ba3035937378ad06f9 @sebastiaanvisser sebastiaanvisser committed Mar 16, 2012
Showing with 7 additions and 3 deletions.
  1. +1 −1 arrow-list.cabal
  2. +6 −2 src/Control/Arrow/ArrowF.hs
View
2 arrow-list.cabal
@@ -1,5 +1,5 @@
Name: arrow-list
-Version: 0.5.1
+Version: 0.6
Synopsis: List arrows for Haskell.
Description: This small Haskell library provides some type class, types
and functions to work with list (and list-like) arrows. List
View
8 src/Control/Arrow/ArrowF.hs
@@ -119,15 +119,17 @@ ifA c t e = proc i -> do x <- results c -< i; if x then t -< i else e -< i
-- | Apply a container arrow only when a conditional arrow produces any
-- results. When the conditional produces no results the output arrow /behaves
-- like the identity/. The /second/ input arrow is used as the conditional,
--- this allow you to write: @ a \`when\` c @
+-- this allow you to write: @ a \`when\` condition @
+
+infix 7 `when`
when :: (Foldable f, ArrowF f (~>), ArrowChoice (~>)) => (a ~> a) -> (a ~> c) -> a ~> a
when a c = ifA c a id
-- | Apply a container arrow only when a conditional arrow produces any
-- results. When the conditional produces no results the output arrow
-- /produces no results/. The /first/ input arrow is used as the conditional,
--- this allow you to write: @ c \`guards\` a @
+-- this allow you to write: @ condition \`guards\` a @
infix 8 `guards`
@@ -150,6 +152,8 @@ notA c = ifA c none id
-- second fallback arrow is applied.
-- Likely written infix like this @ a \`orElse\` b @
+infix 6 `orElse`
+
orElse :: (Foldable f, ArrowF f (~>), ArrowChoice (~>)) => (a ~> b) -> (a ~> b) -> a ~> b
orElse a = ifA a a

0 comments on commit ced6f7d

Please sign in to comment.
Something went wrong with that request. Please try again.