diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-03-05 21:30:12 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-05 21:30:12 +0100 |
commit | bb88a7dfdb377c77264801db01d72f2e8b245199 (patch) | |
tree | debb1bff3ffcd2970c168e8fd22f5a1e3b5651b9 /src/AST | |
parent | 76f047376405d97b113573db8b6997088e9b9383 (diff) |
Compile: Implement EWith (TODO EAccum)
That's going to be a mess
Diffstat (limited to 'src/AST')
-rw-r--r-- | src/AST/Types.hs | 10 |
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 |