Vectorisation utilities
[ghc-hetmet.git] / compiler / vectorise / VectMonad.hs
index 5435fbe..1bd450e 100644 (file)
@@ -1,8 +1,8 @@
-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -w #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
---     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
 -- for details
 
 module VectMonad (
@@ -11,7 +11,7 @@ module VectMonad (
 
   noV, tryV, maybeV, traceMaybeV, orElseV, fixV, localV, closedV, initV,
   liftDs,
-  cloneName, cloneId,
+  cloneName, cloneId, cloneVar,
   newExportedVar, newLocalVar, newDummyVar, newTyVar,
   
   Builtins(..), sumTyCon, prodTyCon,
@@ -141,7 +141,7 @@ initGlobalEnv info instEnvs famInstEnvs
     , global_tycons        = mapNameEnv snd $ vectInfoTyCon info
     , global_datacons      = mapNameEnv snd $ vectInfoDataCon info
     , global_pa_funs       = mapNameEnv snd $ vectInfoPADFun info
-    , global_pr_funs       = emptyVarEnv
+    , global_pr_funs       = emptyNameEnv
     , global_inst_env      = instEnvs
     , global_fam_inst_env  = famInstEnvs
     , global_bindings      = []
@@ -301,6 +301,9 @@ cloneId mk_occ id ty
               | otherwise       = Id.mkLocalId         name ty
       return id'
 
+cloneVar :: Var -> VM Var
+cloneVar var = liftM (setIdUnique var) (liftDs newUnique)
+
 newExportedVar :: OccName -> Type -> VM Var
 newExportedVar occ_name ty 
   = do