diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-03-28 22:40:41 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-28 22:40:41 +0100 |
commit | c06b4bd71a94601d467b509a26c08020d1fbd794 (patch) | |
tree | b16981c769231ef4af2c3ec5f002a01f857d95c6 /src/AST | |
parent | a3ba3bdc5c2f9606a0b98cdf53183841cca07eac (diff) |
Pass around an accumMap (but it's empty still)
Diffstat (limited to 'src/AST')
-rw-r--r-- | src/AST/Weaken.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/AST/Weaken.hs b/src/AST/Weaken.hs index dbb37f7..bd2c244 100644 --- a/src/AST/Weaken.hs +++ b/src/AST/Weaken.hs @@ -36,6 +36,15 @@ splitIdx SNil i = Right i splitIdx (SCons _ _) IZ = Left IZ splitIdx (SCons _ l) (IS i) = first IS (splitIdx l i) +slistIdx :: SList f list -> Idx list t -> f t +slistIdx (SCons x _) IZ = x +slistIdx (SCons _ list) (IS i) = slistIdx list i +slistIdx SNil i = case i of {} + +idx2int :: Idx env t -> Int +idx2int IZ = 0 +idx2int (IS n) = 1 + idx2int n + data env :> env' where WId :: env :> env WSink :: forall t env. env :> (t : env) |