projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
aba1fff
)
Add fixV
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Tue, 17 Jul 2007 05:15:27 +0000
(
05:15
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Tue, 17 Jul 2007 05:15:27 +0000
(
05:15
+0000)
compiler/vectorise/VectMonad.hs
patch
|
blob
|
history
diff --git
a/compiler/vectorise/VectMonad.hs
b/compiler/vectorise/VectMonad.hs
index
c6267a5
..
2e07697
100644
(file)
--- a/
compiler/vectorise/VectMonad.hs
+++ b/
compiler/vectorise/VectMonad.hs
@@
-2,7
+2,7
@@
module VectMonad (
Scope(..),
VM,
- noV, tryV, maybeV, orElseV, localV, closedV, initV,
+ noV, tryV, maybeV, orElseV, fixV, localV, closedV, initV,
cloneName, newLocalVar, newTyVar,
Builtins(..), paDictTyCon,
@@
-201,6
+201,11
@@
maybeV p = maybe noV return =<< p
orElseV :: VM 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 -> runVM (f (unYes r)) bi genv lenv )
+ where
+ unYes (Yes _ _ x) = x
+
localV :: VM a -> VM a
localV p = do
env <- readLEnv id