diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2024-11-12 18:05:25 +0000 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2024-11-12 18:05:25 +0000 |
commit | 6ce6cf4580f2c0ab4c7c4ec56f438c1cc184c7cd (patch) | |
tree | f1704be1e5adef266693429898408bfa4b320688 /src/Inky/Data/Context.idr | |
parent | ecaf9deb4b1d2ce85617438e621690b2df3ea367 (diff) |
Add more names. Names are good.
Diffstat (limited to 'src/Inky/Data/Context.idr')
-rw-r--r-- | src/Inky/Data/Context.idr | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Inky/Data/Context.idr b/src/Inky/Data/Context.idr index 0d3df99..4c5f6cf 100644 --- a/src/Inky/Data/Context.idr +++ b/src/Inky/Data/Context.idr @@ -24,13 +24,11 @@ mapNames f (ctx :< nx) = cong (:< nx.name) $ mapNames f ctx -- Construction ---------------------------------------------------------------- public export -fromAll : (ctx : Context a) -> All (const b) ctx.names -> Context b -fromAll [<] [<] = [<] -fromAll (ctx :< (n :- _)) (sx :< x) = fromAll ctx sx :< (n :- x) +fromAll : {sx : SnocList String} -> All (Assoc0 a) sx -> Context a +fromAll [<] = [<] +fromAll {sx = sx :< n} (ctx :< (_ :- x)) = fromAll ctx :< (n :- x) export -fromAllNames : - (ctx : Context a) -> (sx : All (const b) ctx.names) -> - (fromAll ctx sx).names = ctx.names -fromAllNames [<] [<] = Refl -fromAllNames (ctx :< (n :- _)) (sx :< x) = cong (:< n) $ fromAllNames ctx sx +fromAllNames : {sx : SnocList String} -> (ctx : All (Assoc0 a) sx) -> (fromAll ctx).names = sx +fromAllNames [<] = Refl +fromAllNames {sx = sx :< n} (ctx :< (k :- x)) = cong (:< n) $ fromAllNames ctx |