X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fvectorise%2FVectMonad.hs;h=4ae6c17ecb6002f6e7f2292d1ffe1b189066575d;hb=08652e67c4d5d9a40687f93c286021a867c1bca0;hp=836a0209a089911ef30a00789695fbee256669d1;hpb=bdcefe88baa952422da335cbd743a32db5b06fb6;p=ghc-hetmet.git diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs index 836a020..4ae6c17 100644 --- a/compiler/vectorise/VectMonad.hs +++ b/compiler/vectorise/VectMonad.hs @@ -174,7 +174,7 @@ emptyLocalEnv = LocalEnv { local_vars = emptyVarEnv , local_tyvars = [] , local_tyvar_pa = emptyVarEnv - , local_bind_name = FSLIT("fn") + , local_bind_name = fsLit "fn" } -- FIXME @@ -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 -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 @@ -329,7 +331,7 @@ newLocalVar fs ty return $ mkSysLocal fs u ty newDummyVar :: Type -> VM Var -newDummyVar = newLocalVar FSLIT("ds") +newDummyVar = newLocalVar (fsLit "ds") newTyVar :: FastString -> Kind -> VM Var newTyVar fs k