added boolean type

This commit is contained in:
2017-05-11 17:19:53 +02:00
parent b44d51c448
commit 5603728a9b
3 changed files with 22 additions and 1 deletions

View File

@@ -2,11 +2,13 @@ module BC.Types where
data Value = BInt Integer
| BFloat Double
| BBool Bool
| BOp String
| BErr String
instance Show Value where
show (BInt i) = show i
show (BFloat f) = show f
show (BBool b) = if b then "true" else "false"
show (BOp o) = o
show (BErr e) = "error: " ++ e