From c06b4bd71a94601d467b509a26c08020d1fbd794 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 28 Mar 2025 22:40:41 +0100 Subject: Pass around an accumMap (but it's empty still) --- src/AST/Weaken.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/AST/Weaken.hs') 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) -- cgit v1.2.3-70-g09d2