diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-09-12 17:31:20 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-09-12 17:31:42 +0200 |
commit | 36732f84cfade5371248806328791d5066673fb7 (patch) | |
tree | 68cf208fca197a48e6b0506e783c1bdaf98d2e42 /src/Interpreter/Rep.hs | |
parent | 1f53cea6a1352db125e1897ca574360180be2550 (diff) |
Interpreter, some operations
Diffstat (limited to 'src/Interpreter/Rep.hs')
-rw-r--r-- | src/Interpreter/Rep.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Interpreter/Rep.hs b/src/Interpreter/Rep.hs new file mode 100644 index 0000000..1ded773 --- /dev/null +++ b/src/Interpreter/Rep.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TypeFamilies #-} +module Interpreter.Rep where + +import GHC.TypeError + +import Array +import AST + + +type family Rep t where + Rep TNil = () + Rep (TPair a b) = (Rep a, Rep b) + Rep (TEither a b) = Either (Rep a) (Rep b) + Rep (TArr n t) = Array n (Rep t) + Rep (TScal sty) = ScalRep sty + Rep (TAccum t) = TypeError (Text "Accumulator in Rep") |