aboutsummaryrefslogtreecommitdiff
path: root/Utility/Matcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-17 00:22:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-17 00:38:40 -0400
commita362c46b70c45872ff8c479ba5a6716cf13cc8d8 (patch)
treee8f08204dc679a1d7c23b5cd466606e7877a2469 /Utility/Matcher.hs
parentd6624b6c798df401eb9e715810537d2b93935a76 (diff)
fun with symbols
Nothing at all on hackage is using <&&> or <||>. (Also, <&&> should short-circuit on failure.)
Diffstat (limited to 'Utility/Matcher.hs')
-rw-r--r--Utility/Matcher.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utility/Matcher.hs b/Utility/Matcher.hs
index 71e1e17f4..9b6005767 100644
--- a/Utility/Matcher.hs
+++ b/Utility/Matcher.hs
@@ -78,8 +78,8 @@ match a m v = go m
where
go MAny = True
go (MAnd m1 m2) = go m1 && go m2
- go (MOr m1 m2) = go m1 || go m2
- go (MNot m1) = not (go m1)
+ go (MOr m1 m2) = go m1 || go m2
+ go (MNot m1) = not $ go m1
go (MOp o) = a o v
{- Runs a monadic Matcher, where Operations are actions in the monad. -}
@@ -87,8 +87,8 @@ matchM :: Monad m => Matcher (v -> m Bool) -> v -> m Bool
matchM m v = go m
where
go MAny = return True
- go (MAnd m1 m2) = andM (go m1) (go m2)
- go (MOr m1 m2) = orM (go m1) (go m2)
+ go (MAnd m1 m2) = go m1 <&&> go m2
+ go (MOr m1 m2) = go m1 <||> go m2
go (MNot m1) = liftM not (go m1)
go (MOp o) = o v