add CanShift interface like CanSubst

This commit is contained in:
rhiannon morris 2021-09-09 23:53:00 +02:00
parent b29b7855a2
commit a2be5a468d
3 changed files with 12 additions and 1 deletions

View file

@ -172,3 +172,11 @@ prettyShift bnd by =
||| prints using the `TVar` highlight for variables
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

View file

@ -1,6 +1,6 @@
module Quox.Syntax.Subst
import Quox.Syntax.Shift
import public Quox.Syntax.Shift
import Quox.Syntax.Var
import Quox.Name
import Quox.Pretty

View file

@ -207,6 +207,9 @@ CanSubst (Elim d) (Term d) where
s // Shift SZ = s
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 ///
mutual