mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-09-21 22:17:19 +03:00
Change Show instance for Nat to show integers
This commit is contained in:
parent
7af449c5e7
commit
d8580163a1
@ -24,10 +24,6 @@ import Prelude.Chars
|
||||
class Show a where
|
||||
show : a -> String
|
||||
|
||||
instance Show Nat where
|
||||
show O = "O"
|
||||
show (S k) = "s" ++ show k
|
||||
|
||||
instance Show Int where
|
||||
show = prim__toStrInt
|
||||
|
||||
@ -43,6 +39,9 @@ instance Show Char where
|
||||
instance Show String where
|
||||
show = id
|
||||
|
||||
instance Show Nat where
|
||||
show n = show (the Integer (cast n))
|
||||
|
||||
instance Show Bool where
|
||||
show True = "True"
|
||||
show False = "False"
|
||||
|
@ -1,2 +1,2 @@
|
||||
O
|
||||
sO
|
||||
0
|
||||
1
|
||||
|
@ -1 +1 @@
|
||||
ssssO
|
||||
4
|
||||
|
@ -1,5 +1,5 @@
|
||||
8
|
||||
sO
|
||||
1
|
||||
(abc, 123)
|
||||
(abc, 123)
|
||||
([1, 2], [3, 4, 5])
|
||||
|
@ -1,4 +1,4 @@
|
||||
Just 8
|
||||
Just sssssssssO
|
||||
Just 9
|
||||
Just 42
|
||||
Nothing
|
||||
|
@ -1 +1 @@
|
||||
sO
|
||||
1
|
||||
|
Loading…
Reference in New Issue
Block a user