summaryrefslogtreecommitdiff
path: root/src/SOAS/Context.idr
diff options
context:
space:
mode:
authorGreg Brown <greg.brown01@ed.ac.uk>2024-02-01 15:23:47 +0000
committerGreg Brown <greg.brown01@ed.ac.uk>2024-02-02 13:32:49 +0000
commit6dde244c14410ede6d41e9a8607016e23c19e320 (patch)
treed693694f65706b9653489effd15f27a40406ae43 /src/SOAS/Context.idr
parentd90419ce0740331c8ef9ecdd77e875b3367331d3 (diff)
Split monolithic file into modules.
Prove metatheory for generic initial algebras, instead of a clunky concrete one.
Diffstat (limited to 'src/SOAS/Context.idr')
-rw-r--r--src/SOAS/Context.idr24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/SOAS/Context.idr b/src/SOAS/Context.idr
new file mode 100644
index 0000000..25d2308
--- /dev/null
+++ b/src/SOAS/Context.idr
@@ -0,0 +1,24 @@
+module SOAS.Context
+
+infixr 4 :-
+
+public export
+record (.extension) (type : Type) where
+ constructor (:-)
+ 0 name : String
+ ofType : type
+
+public export
+data (.Ctx) : (type : Type) -> Type where
+ Lin : type.Ctx
+ (:<) : (ctx : type.Ctx) -> (namety : type.extension) -> type.Ctx
+
+public export
+data (.Erased) : type.Ctx -> Type where
+ Z : [<].Erased
+ S : ctx.Erased -> (ctx :< x).Erased
+
+public export
+(++) : (ctx1,ctx2 : type.Ctx) -> type.Ctx
+ctx1 ++ [<] = ctx1
+ctx1 ++ (ctx2 :< ty) = (ctx1 ++ ctx2) :< ty