add CanShift interface like CanSubst
This commit is contained in:
parent
b29b7855a2
commit
a2be5a468d
3 changed files with 12 additions and 1 deletions
|
@ -172,3 +172,11 @@ prettyShift bnd by =
|
||||||
|
|
||||||
||| prints using the `TVar` highlight for variables
|
||| prints using the `TVar` highlight for variables
|
||||||
export PrettyHL (Shift from to) where prettyM = prettyShift TVar
|
export PrettyHL (Shift from to) where prettyM = prettyShift TVar
|
||||||
|
|
||||||
|
|
||||||
|
infixl 8 //
|
||||||
|
public export
|
||||||
|
interface CanShift f where
|
||||||
|
(//) : f from -> Shift from to -> f to
|
||||||
|
|
||||||
|
export CanShift Var where i // by = shift by i
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module Quox.Syntax.Subst
|
module Quox.Syntax.Subst
|
||||||
|
|
||||||
import Quox.Syntax.Shift
|
import public Quox.Syntax.Shift
|
||||||
import Quox.Syntax.Var
|
import Quox.Syntax.Var
|
||||||
import Quox.Name
|
import Quox.Name
|
||||||
import Quox.Pretty
|
import Quox.Pretty
|
||||||
|
|
|
@ -207,6 +207,9 @@ CanSubst (Elim d) (Term d) where
|
||||||
s // Shift SZ = s
|
s // Shift SZ = s
|
||||||
s // th = CloT s th
|
s // th = CloT s th
|
||||||
|
|
||||||
|
export CanShift (Term d) where i // by = i // Shift by {env=(Elim d)}
|
||||||
|
export CanShift (Elim d) where i // by = i // Shift by {env=(Elim d)}
|
||||||
|
|
||||||
|
|
||||||
infixl 8 ///
|
infixl 8 ///
|
||||||
mutual
|
mutual
|
||||||
|
|
Loading…
Reference in a new issue