Skip to content

Commit

Permalink
chore: bump Lean version
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Dec 18, 2024
1 parent 248962a commit cd49c68
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.15.0-rc1
leanprover/lean4:nightly-2024-12-17
4 changes: 2 additions & 2 deletions src/verso/Verso/Code/Highlighted.lean
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ where
def _root_.Array.mapIndexed (arr : Array α) (f : Fin arr.size → α → β) : Array β := Id.run do
let mut out := #[]
for h : i in [:arr.size] do
out := out.push (f ⟨i, h.right⟩ arr[i])
out := out.push (f ⟨i, by get_elem_tactic⟩ arr[i])
out

def _root_.Array.mapIndexedM [Monad m] (arr : Array α) (f : Fin arr.size → α → m β) : m (Array β) := do
let mut out := #[]
for h : i in [:arr.size] do
out := out.push (← f ⟨i, h.right⟩ arr[i])
out := out.push (← f ⟨i, by get_elem_tactic⟩ arr[i])
pure out


Expand Down
13 changes: 5 additions & 8 deletions src/verso/Verso/Doc.lean
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ inductive MathMode where | inline | display
deriving Repr, BEq, Hashable, Ord, ToJson, FromJson

private def arrayEq (eq : α → α → Bool) (xs ys : Array α) : Bool := Id.run do
if h : xs.size = ys.size then
for h' : i in [0:xs.size] do
have : i < ys.size := by
let ⟨_, h''⟩ := h'
simp [*] at h''; assumption
if !(eq xs[i] ys[i]) then return false
return true
else return false
if xs.size = ys.size then
for x in xs, y in ys do
if !(eq x y) then return false
return true
else return false

inductive Inline (genre : Genre) : Type where
| text (string : String)
Expand Down
4 changes: 3 additions & 1 deletion src/verso/Verso/Hover.lean
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ deriving TypeName
def addCustomHover [Monad m] [MonadInfoTree m] [MonadLiftT IO m] (stx : Syntax) (hover : UserHover) : m Unit := do
let txt ← match hover with
| .markdown str => pure str
| .messageData m => m.toString
-- TODO Change signature to MonadLiftT BaseIO m. This formulation is for a bit wider
-- compatibility in December 2024, but after another release it can go away.
| .messageData m => (m.toString : IO String)
pushInfoLeaf <| .ofCustomInfo ⟨stx, .mk <| CustomHover.mk txt⟩

0 comments on commit cd49c68

Please sign in to comment.