diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-09-22 14:32:49 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-09-22 14:32:49 +0200 |
commit | 157f64af7070d312f06d0539115da2be11754b6c (patch) | |
tree | 4b5d73b14f063c314b83b99f8ad938ea8ea709fb /src/AST.hs | |
parent | 7f62bd9057f0ac06a74911193bfc964d11a575cf (diff) |
Some hacking
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -13,6 +13,7 @@ {-# LANGUAGE StandaloneKindSignatures #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} +{-# LANGUAGE UndecidableInstances #-} module AST (module AST, module AST.Types, module AST.Weaken) where import Data.Functor.Const @@ -43,8 +44,12 @@ type family AcVal t i where AcVal (TPair a b) (S i) = TEither (AcVal a i) (AcVal b i) AcVal (TEither a b) (S i) = TEither (AcVal a i) (AcVal b i) AcVal (TMaybe t) (S i) = AcVal t i - AcVal (TArr Z t) (S i) = AcVal t i - AcVal (TArr (S n) t) (S i) = AcVal (TArr n t) i + AcVal (TArr n t) (S i) = TPair (Tup (Replicate n TIx)) (AcValArr n t (S i)) + +type family AcValArr n t i where + AcValArr n t Z = TArr n t + AcValArr Z t (S i) = AcVal t i + AcValArr (S n) t (S i) = AcValArr n t i -- General assumption: head of the list (whatever way it is associated) is the -- inner variable / inner array dimension. In pretty printing, the inner |