module CalcTypes where
data Expr = Lit Integer | Var Var | Op Ops Expr Expr deriving (Expr -> Expr -> Bool
(Expr -> Expr -> Bool) -> (Expr -> Expr -> Bool) -> Eq Expr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Expr -> Expr -> Bool
== :: Expr -> Expr -> Bool
$c/= :: Expr -> Expr -> Bool
/= :: Expr -> Expr -> Bool
Eq,Int -> Expr -> ShowS
[Expr] -> ShowS
Expr -> String
(Int -> Expr -> ShowS)
-> (Expr -> String) -> ([Expr] -> ShowS) -> Show Expr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Expr -> ShowS
showsPrec :: Int -> Expr -> ShowS
$cshow :: Expr -> String
show :: Expr -> String
$cshowList :: [Expr] -> ShowS
showList :: [Expr] -> ShowS
Show)
data Ops = Add | Sub | Mul | Div | Mod deriving (Ops -> Ops -> Bool
(Ops -> Ops -> Bool) -> (Ops -> Ops -> Bool) -> Eq Ops
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Ops -> Ops -> Bool
== :: Ops -> Ops -> Bool
$c/= :: Ops -> Ops -> Bool
/= :: Ops -> Ops -> Bool
Eq,Int -> Ops -> ShowS
[Ops] -> ShowS
Ops -> String
(Int -> Ops -> ShowS)
-> (Ops -> String) -> ([Ops] -> ShowS) -> Show Ops
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Ops -> ShowS
showsPrec :: Int -> Ops -> ShowS
$cshow :: Ops -> String
show :: Ops -> String
$cshowList :: [Ops] -> ShowS
showList :: [Ops] -> ShowS
Show)
type Var = Char
data Command = Eval Expr | Assign Var Expr | Null deriving (Command -> Command -> Bool
(Command -> Command -> Bool)
-> (Command -> Command -> Bool) -> Eq Command
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Command -> Command -> Bool
== :: Command -> Command -> Bool
$c/= :: Command -> Command -> Bool
/= :: Command -> Command -> Bool
Eq,Int -> Command -> ShowS
[Command] -> ShowS
Command -> String
(Int -> Command -> ShowS)
-> (Command -> String) -> ([Command] -> ShowS) -> Show Command
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Command -> ShowS
showsPrec :: Int -> Command -> ShowS
$cshow :: Command -> String
show :: Command -> String
$cshowList :: [Command] -> ShowS
showList :: [Command] -> ShowS
Show)