diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2024-10-09 16:26:23 +0100 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2024-10-09 16:26:23 +0100 |
commit | 8b326bb4a879be72cb6382519350cbb5231f7a6e (patch) | |
tree | beff7c254f31795bb6cfee2b0b90ad147ab5ba32 /src/Inky/Type.idr | |
parent | 405519b406174bec161bc4d23deb0551b1ed31ac (diff) |
Do a lot.
- Add type aliases.
- Make `suc` a symbol.
- Fix incorrect specification for `IsFunction`.
- Write parser for terms.
- Use `collie` to improve command line experience.
Diffstat (limited to 'src/Inky/Type.idr')
-rw-r--r-- | src/Inky/Type.idr | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Inky/Type.idr b/src/Inky/Type.idr index 9cfc1f7..26f3c0f 100644 --- a/src/Inky/Type.idr +++ b/src/Inky/Type.idr @@ -406,3 +406,16 @@ subAll env ((:<) as (x :- a) {fresh}) = subAllFresh env x [<] = id subAllFresh env x (as :< (y :- a)) = andSo . mapSnd (subAllFresh env x as) . soAnd + +-- Expansion ------------------------------------------------------------------- + +export +expandEnv : DEnv Ty ctx -> Env ctx [<] (Ty [<]) +expandEnv [<] = Base Id +expandEnv {ctx = ctx :< (x :- v)} (env :< (y :- a)) = + let env' = expandEnv env in + expandEnv env :< (x :- sub env' a) + +export +expand : DEnv Ty ctx -> Ty ctx v -> Ty [<] v +expand = sub . expandEnv |