Skip to content

Commit

Permalink
chore: ToExpr Int (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em authored Dec 16, 2023
1 parent 9dd24a3 commit ebdd969
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Std/Data/Int/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Std.Classes.Dvd
import Lean.ToExpr

open Nat

Expand Down Expand Up @@ -164,3 +165,10 @@ protected def shiftRight : Int → Nat → Int
| Int.negSucc n, s => Int.negSucc (n >>> s)

instance : HShiftRight Int Nat Int := ⟨.shiftRight⟩

open Lean in
instance : ToExpr Int where
toTypeExpr := .const ``Int []
toExpr i := match i with
| .ofNat n => mkApp (.const ``Int.ofNat []) (toExpr n)
| .negSucc n => mkApp (.const ``Int.negSucc []) (toExpr n)

0 comments on commit ebdd969

Please sign in to comment.