feat(library/init/data): modify unit has_to_string and has_repr instances
This commit is contained in:
parent
3f812698a9
commit
21d9409629
2 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ instance {α : Type u} [has_repr α] : has_repr (list α) :=
|
|||
⟨list.repr⟩
|
||||
|
||||
instance : has_repr unit :=
|
||||
⟨λ u, "star"⟩
|
||||
⟨λ u, "()"⟩
|
||||
|
||||
instance {α : Type u} [has_repr α] : has_repr (option α) :=
|
||||
⟨λ o, match o with | none := "none" | (some a) := "(some " ++ repr a ++ ")" end⟩
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ instance {α : Type u} [has_to_string α] : has_to_string (list α) :=
|
|||
⟨list.to_string⟩
|
||||
|
||||
instance : has_to_string unit :=
|
||||
⟨λ u, "star"⟩
|
||||
⟨λ u, "()"⟩
|
||||
|
||||
instance : has_to_string nat :=
|
||||
⟨λ n, repr n⟩
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue