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:
e5adcaf
)
Fix vectorisation monad
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Fri, 7 Mar 2008 05:08:59 +0000
(
05:08
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Fri, 7 Mar 2008 05:08:59 +0000
(
05:08
+0000)
compiler/vectorise/VectMonad.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/VectMonad.hs
b/compiler/vectorise/VectMonad.hs
index
836a020
..
b47da65
100644
(file)
--- a/
compiler/vectorise/VectMonad.hs
+++ b/
compiler/vectorise/VectMonad.hs
@@
-228,10
+228,12
@@
orElseV :: VM a -> VM a -> VM a
orElseV p q = maybe q return =<< tryV p
fixV :: (a -> VM a) -> VM a
orElseV p q = maybe q return =<< tryV p
fixV :: (a -> VM a) -> VM a
-fixV f = VM $ \bi genv lenv -> fixDs $
- \r -> case r of
- Yes _ _ x -> runVM (f x) bi genv lenv
- No -> return No
+fixV f = VM (\bi genv lenv -> fixDs $ \r -> runVM (f (unYes r)) bi genv lenv )
+ where
+ -- NOTE: It is essential that we are lazy in r above so do not replace
+ -- calls to this function by an explicit case.
+ unYes (Yes _ _ x) = x
+ unYes No = panic "VectMonad.fixV: no result"
localV :: VM a -> VM a
localV p = do
localV :: VM a -> VM a
localV p = do