feat(library/init/data/to_string): mark list.to_string as protected
This commit is contained in:
parent
26ead0e7ac
commit
1d0d45d890
2 changed files with 3 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ notation `-[1+ ` n `]` := int.neg_succ_of_nat n
|
|||
instance : decidable_eq int :=
|
||||
by tactic.mk_dec_eq_instance
|
||||
|
||||
private def int.to_string : int → string
|
||||
protected def int.to_string : int → string
|
||||
| (int.of_nat n) := to_string n
|
||||
| (int.neg_succ_of_nat n) := "-" ++ to_string (succ n)
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ instance {p : Prop} : has_to_string (decidable p) :=
|
|||
-- Remark: type class inference will not consider local instance `b` in the new elaborator
|
||||
⟨λ b : decidable p, @ite p b _ "tt" "ff"⟩
|
||||
|
||||
def list.to_string_aux {α : Type u} [has_to_string α] : bool → list α → string
|
||||
protected def list.to_string_aux {α : Type u} [has_to_string α] : bool → list α → string
|
||||
| b [] := ""
|
||||
| tt (x::xs) := to_string x ++ list.to_string_aux ff xs
|
||||
| ff (x::xs) := ", " ++ to_string x ++ list.to_string_aux ff xs
|
||||
|
||||
def list.to_string {α : Type u} [has_to_string α] : list α → string
|
||||
protected def list.to_string {α : Type u} [has_to_string α] : list α → string
|
||||
| [] := "[]"
|
||||
| (x::xs) := "[" ++ list.to_string_aux tt (x::xs) ++ "]"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue