diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2024-11-15 15:44:30 +0000 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2024-11-15 15:44:30 +0000 |
commit | 3caa95a139538bb07c74847ca3aba2603a03c502 (patch) | |
tree | afa588ecffb2efd05b1202c7ce5ae6005c86b8d2 /src/Inky/Data/Context.idr | |
parent | 865dc549baf613e45e2f79036d54850a483fa509 (diff) |
Add compilation to scheme.
Extract parser as an independent project.
Diffstat (limited to 'src/Inky/Data/Context.idr')
-rw-r--r-- | src/Inky/Data/Context.idr | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/Inky/Data/Context.idr b/src/Inky/Data/Context.idr deleted file mode 100644 index 4c5f6cf..0000000 --- a/src/Inky/Data/Context.idr +++ /dev/null @@ -1,34 +0,0 @@ -module Inky.Data.Context - -import public Inky.Data.Assoc -import public Inky.Data.SnocList - -import Inky.Data.SnocList.Quantifiers - --- Contexts -------------------------------------------------------------------- - -public export -Context : Type -> Type -Context a = SnocList (Assoc a) - -public export -(.names) : Context a -> SnocList String -[<].names = [<] -(ctx :< nx).names = ctx.names :< nx.name - -export -mapNames : (0 f : a -> b) -> (ctx : Context a) -> (map (map f) ctx).names = ctx.names -mapNames f [<] = Refl -mapNames f (ctx :< nx) = cong (:< nx.name) $ mapNames f ctx - --- Construction ---------------------------------------------------------------- - -public export -fromAll : {sx : SnocList String} -> All (Assoc0 a) sx -> Context a -fromAll [<] = [<] -fromAll {sx = sx :< n} (ctx :< (_ :- x)) = fromAll ctx :< (n :- x) - -export -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 |