summaryrefslogtreecommitdiff
path: root/src/AST/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/AST/Types.hs')
-rw-r--r--src/AST/Types.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/AST/Types.hs b/src/AST/Types.hs
index adcc760..acf7053 100644
--- a/src/AST/Types.hs
+++ b/src/AST/Types.hs
@@ -107,3 +107,13 @@ type family ScalIsIntegral t where
ScalIsIntegral TF32 = False
ScalIsIntegral TF64 = False
ScalIsIntegral TBool = False
+
+-- | Returns true for arrays /and/ accumulators;
+hasArrays :: STy t' -> Bool
+hasArrays STNil = False
+hasArrays (STPair a b) = hasArrays a || hasArrays b
+hasArrays (STEither a b) = hasArrays a || hasArrays b
+hasArrays (STMaybe t) = hasArrays t
+hasArrays STArr{} = True
+hasArrays STScal{} = False
+hasArrays STAccum{} = True