data Either a b = Left a | Right b data List a = Nil | Cons a (List a) data Nat = Zero | Succ Nat sum Zero a = a sum a Zero = a sum (Succ a) (Succ b) = Succ (Succ (sum a b)) sum_append xs ys = go Zero (Left xs) where go z (Left xs) = match xs with Nil -> go z (Right ys) Cons x xs' -> go (sum x z) (Left xs') go z (Right ys) = match ys with Nil -> z Cons y ys' -> go (sum y z) (Right ys') main = "Hello world!" -- Hello world!