-- |Subsitute a variable in an expression with another expression
subs :: Expr -> Name -> Expr -> ThrowError Expr
subs (AppExpr e1 e2) old new = do
    s1 <- (subs e1 old new)
    s2 <- (subs e2 old new)
    return $ AppExpr s1 s2
subs :: Expr -> Name -> Expr -> ThrowError Expr
subs (AppExpr e1 e2) old new = do
    s1 <- (subs e1 old new)
    s2 <- (subs e2 old new)
    return $ AppExpr s1 s2
subs (AppExpr e1 e2) old new = do
    s1 <- (subs e1 old new)
    s2 <- (subs e2 old new)
    return $ AppExpr s1 s2