module Template_03(prodList, squareSecond, List(..), eval, convert, normalize, listToExpr, Expr(..)) where -- Exercise 2 data Brand = Audi | BMW | Fiat | Lamborghini deriving Show data Vehicle = Car Brand Double -- horsepower | Bicycle | Truck Int -- number of wheels deriving Show data List = Cons Integer List | Empty deriving Show validVehicle :: Vehicle -> Bool validVehicle = undefined prodList :: List -> Integer prodList = undefined squareSecond :: List -> List squareSecond = undefined -- Exercise 3 data Expr = Number Integer | Plus Expr Expr | Negate Expr deriving Show eval :: Expr -> Integer eval (Number x) = x eval (Plus e1 e2) = eval e1 + eval e2 eval (Negate e) = - eval e ite True x y = x ite False x y = y convert :: Expr -> Expr convert = undefined normalize :: Expr -> Expr normalize = undefined listToExpr :: List -> Expr listToExpr = undefined