Add utility function for vectorisation
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Fri, 13 Jul 2007 07:32:27 +0000 (07:32 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Fri, 13 Jul 2007 07:32:27 +0000 (07:32 +0000)
compiler/vectorise/VectUtils.hs

index 5cd0471..630c425 100644 (file)
@@ -2,7 +2,8 @@ module VectUtils (
   collectAnnTypeBinders, collectAnnTypeArgs, isAnnTypeArg,
   splitClosureTy,
   mkPADictType, mkPArrayType,
-  paDictArgType, paDictOfType
+  paDictArgType, paDictOfType,
+  lookupPArrayFamInst
 ) where
 
 #include "HsVersions.h"
@@ -104,3 +105,6 @@ paDFunApply dfun tys
       dicts <- mapM paDictOfType tys
       return $ mkApps (mkTyApps dfun tys) dicts
 
+lookupPArrayFamInst :: Type -> VM (TyCon, [Type])
+lookupPArrayFamInst ty = builtin parrayTyCon >>= (`lookupFamInst` [ty])
+