data Date = -- name of type DMY -- name of constructor Int -- day Int -- month Integer -- year deriving Show data Person = -- name of type Person -- constructor name can be same as type name String -- first name String -- last name Bool -- married Date -- birthday deriving Show today :: Date today = DMY 14 10 2024 myself, myself2, myself3 :: Person myself = Person "Rene" "Thiemann" True today myself2 = Person "Rene" "Thiemann" True (DMY 14 10 2024) myself3 = Person "Rene" "Thiemann" (5 > 3) (DMY 14 (length "0123456789") 2024) {- not working: myself4 = Person ("Rene", "Thiemann", True, DMY (14, 10, 2024)) myself5 = Person "Rene" "Thiemann" True DMY 14 10 2024 -} data Brand = Audi | BMW | Fiat | Lamborghini deriving Show data Vehicle = Car Brand Double -- horsepower | Bicycle | Truck Int -- number of wheels deriving Show data Expr = Number Integer | Variable String | Plus Expr Expr | Negate Expr deriving Show data List = Empty | Cons Integer List deriving Show exampleExpression :: Expr exampleExpression = Plus (Negate (Plus (Number 5) (Variable "x"))) (Number 3)