normalForm :: LC IdInt -> LC IdInt
normalForm e@(Var _) = e
normalForm (Lam x e) = Lam x (normalForm e)
normalForm (App f a) =
    case weekHeadNormalForm f of
        Lam x b -> normalForm (substitute x a b)
        f'      -> App (normalForm f') (normalForm a)

-- | Computes week head normal form only for Application
weekHeadNormalForm :: LC IdInt -> LC IdInt
weekHeadNormalForm e@(Var _) = e
weekHeadNormalForm e@(Lam _ _) = e
weekHeadNormalForm (App f a) =