data Pair a b = Pair { first:: a, second:: b } deriving Show empty = Pair 0 False -- we still rely on polymorphism cons x r = Pair 1 ( Pair x r ) list = cons 1 (cons 2 (cons 3 empty)) --
data Pair a b = Pair { first:: a, second:: b } deriving Show empty = Pair 0 False -- we still rely on polymorphism cons x r = Pair 1 ( Pair x r ) list = cons 1 (cons 2 (cons 3 empty)) --