projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17f080e
)
Add orElse combinator for vectorisation monad
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Mon, 9 Jul 2007 05:37:40 +0000
(
05:37
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Mon, 9 Jul 2007 05:37:40 +0000
(
05:37
+0000)
compiler/vectorise/Vectorise.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/Vectorise.hs
b/compiler/vectorise/Vectorise.hs
index
41b360e
..
d662142
100644
(file)
--- a/
compiler/vectorise/Vectorise.hs
+++ b/
compiler/vectorise/Vectorise.hs
@@
-166,6
+166,9
@@
tryV (VM p) = VM $ \bi env -> do
maybeV :: VM (Maybe a) -> VM a
maybeV p = maybe noV return =<< p
+orElseV :: VM a -> VM a -> VM a
+orElseV p q = maybe q return =<< tryV p
+
liftDs :: DsM a -> VM a
liftDs p = VM $ \bi env -> do { x <- p; return (Yes env x) }