Change Show instance for Nat to show integers

This commit is contained in:
Edwin Brady 2013-06-28 17:24:28 +02:00
parent 7af449c5e7
commit d8580163a1
6 changed files with 9 additions and 10 deletions

View File

@ -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"

View File

@ -1,2 +1,2 @@
O
sO
0
1

View File

@ -1 +1 @@
ssssO
4

View File

@ -1,5 +1,5 @@
8
sO
1
(abc, 123)
(abc, 123)
([1, 2], [3, 4, 5])

View File

@ -1,4 +1,4 @@
Just 8
Just sssssssssO
Just 9
Just 42
Nothing

View File

@ -1 +1 @@
sO
1