add casts to Integer for Var & Shift
This commit is contained in:
parent
610b5fde2d
commit
9b260529c8
2 changed files with 4 additions and 2 deletions
|
@ -23,7 +23,8 @@ public export
|
|||
(SS by).nat = S by.nat
|
||||
%transform "Shift.(.nat)" Shift.(.nat) = believe_me
|
||||
|
||||
public export Cast (Shift from to) Nat where cast = (.nat)
|
||||
public export Cast (Shift from to) Nat where cast = (.nat)
|
||||
public export Cast (Shift from to) Integer where cast = cast . cast {to = Nat}
|
||||
|
||||
export Eq (Shift from to) where (==) = (==) `on` (.nat)
|
||||
export Ord (Shift from to) where compare = compare `on` (.nat)
|
||||
|
|
|
@ -23,7 +23,8 @@ public export
|
|||
(VS i).nat = S i.nat
|
||||
%transform "Var.(.nat)" Var.(.nat) i = believe_me i
|
||||
|
||||
public export Cast (Var n) Nat where cast n = n.nat
|
||||
public export Cast (Var n) Nat where cast = (.nat)
|
||||
public export Cast (Var n) Integer where cast = cast . cast {to = Nat}
|
||||
|
||||
export Eq (Var n) where i == j = i.nat == j.nat
|
||||
export Ord (Var n) where compare i j = compare i.nat j.nat
|
||||
|
|
Loading…
Reference in a new issue