state thing a
thing -> (thing, a)
b -> state thing a
Given [Fun] -> State (int, int) Fun:
xs = do
(fn, vn) <- get -- getting the state
let vs = zip (fun.symbols xs) [v..] -- [(n, f'1),... (n+m, f'm)]
{-
given [(n, f'1),... (n+m, f'm)] and [f1, f2, f3, ..., fm]
for each f take its funciton name and replace it with new name using the substitude_f
-}
let new_funs = foldr (\sub funs -> map (substitute_f sub) funs) vs
substitute_f :: (String, Int) -> Fun -> Fun
substitute_f = undefinedplusplus :: State int int -- gives back the current, incrementing the other