diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-11-23 12:12:03 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-11-23 12:12:03 +0100 |
commit | 7774da51c532006da82617ce307d136897693280 (patch) | |
tree | 9d1fc355e1a9e81cef42808f4efe326cc74b7e5d /src/CHAD/Heuristics.hs | |
parent | 883bfad4bf0c5f383c986ebbb9e9dab61e3c2098 (diff) |
Prepare for introducing top-level args in accum mod
Diffstat (limited to 'src/CHAD/Heuristics.hs')
-rw-r--r-- | src/CHAD/Heuristics.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/CHAD/Heuristics.hs b/src/CHAD/Heuristics.hs new file mode 100644 index 0000000..6ab8222 --- /dev/null +++ b/src/CHAD/Heuristics.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE GADTs #-} +module CHAD.Heuristics where + +import AST + + +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{} = error "Accumulators not allowed in source program" |