Added support for vectors with arbitrary element types
[matthijs/master-project/cλash.git] / CoreTools.hs
index 85c398ab7c2777bb920c749033f28caa2594d6c4..3c26793c8c804ce7f9dd7262851565398638195d 100644 (file)
@@ -95,6 +95,13 @@ tfvec_len ty =
   where 
     (tycon, args) = Type.splitTyConApp ty
     [len, el_ty] = args
+    
+-- | Get the element type of a TFVec type
+tfvec_elem :: Type.Type -> Type.Type
+tfvec_elem ty = el_ty
+  where
+    (tycon, args) = Type.splitTyConApp ty
+    [len, el_ty] = args
 
 -- Is this a wild binder?
 is_wild :: CoreSyn.CoreBndr -> Bool