eval (App e1 e2) = do
    v1 <- eval e1
    v2 <- eval e2
    case v1 of
        (Abs bnd _) -> do
            (x, body) <- unbind bnd
            let body' = subst x v2 body
            eval body'
        _ -> throwError "application of non-lambda"
eval (App e1 e2) = do
    v1 <- eval e1
    v2 <- eval e2
    case v1 of
        (Abs bnd _) -> do
            (x, body) <- unbind bnd
            let body' = subst x v2 body
            eval body'
        _ -> throwError "application of non-lambda"
eval (App e1 e2) = do
    v1 <- eval e1
    v2 <- eval e2
    case v1 of
        (Abs bnd _) -> do
            (x, body) <- unbind bnd
            let body' = subst x v2 body
            eval body'
        _ -> throwError "application of non-lambda"