Rough notes from our REPL session.
-- Type classes:
-- Num : supports (+), (-), (*)
-- Eq : supports (==), (/=)
-- Ord : supports (<), (<=), (>), (>=), compare
-- "Data type" declaration.
data Color = Red | Green | Blue
| Cyan | Magenta | Yellow
deriving (Show, Eq, Enum, Bounded)
-- Maybe is a type constructor for saying
-- that a value of that type may be present
-- or absent (Just or Nothing)
-- maybe is a function that allows us
-- to process a Maybe value by specifying
-- a default to use in case it is Nothing.
fact1 :: Integer -> Integer
fact1 n
| n < 0 = error "Negative"
| n == 0 = 1
| otherwise = n * fact1 (n-1)