on bbb2b2a help sign in
21 lines 456 B history raw
1{-# LANGUAGE DeriveDataTypeable #-}
2module SourceSyntax.Literal where
4import Data.Data
6data Literal = IntNum Int
7 | FloatNum Float
8 | Chr Char
9 | Str String
10 | Boolean Bool
11 deriving (Eq, Data, Typeable)
14instance Show Literal where
15 show e =
16 case e of
17 IntNum n -> show n
18 FloatNum n -> show n
19 Chr c -> show c
20 Str s -> show s
21 Boolean b -> show b