Skip to content

Commit

Permalink
refactor: do not use explicit instance, but use deriving instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFabian authored and leodemoura committed Jul 13, 2021
1 parent 0d41fd0 commit 93a3fd1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Init/Data/String/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,11 @@ def intercalate (s : String) (ss : List String) : String :=
structure Iterator where
s : String
i : Pos
deriving DecidableEq

def mkIterator (s : String) : Iterator :=
⟨s, 0

instance : DecidableEq Iterator := fun ⟨s₁, i₁⟩ ⟨s₂, i₂⟩ =>
if h₁ : i₁ = i₂ ∧ s₁ = s₂ then isTrue (by simp_all) else isFalse (λ h₂ => by simp_all)

namespace Iterator
def toString : Iterator → String
| ⟨s, _⟩ => s
Expand Down

0 comments on commit 93a3fd1

Please sign in to comment.