CurryInfo: failfree-4.0.0 / Main.renameFreeVars

definition:
renameFreeVars :: [(VarIndex, TypeExpr)] -> TAExpr
               -> TransStateM ([(VarIndex, TypeExpr)], TAExpr)
renameFreeVars freevars exp = do
  fv <- getFreshVarIndex
  let args = map fst freevars
      minarg = minimum (0 : args)
      maxarg = maximum (0 : args)
      rnm i = if i `elem` args then i - minarg + fv else i
      nargs = map (\ (v,t) -> (rnm v,t)) freevars
  setFreshVarIndex (fv + maxarg - minarg + 1)
  addVarTypes nargs
  return (map (\ (v,t) -> (rnm v,t)) freevars, rnmAllVars rnm exp)
demand:
no demanded arguments
deterministic:
deterministic operation
documentation:
-- Rename free variables introduced in an expression.
indeterministic:
referentially transparent operation
infix:
no fixity defined
name:
renameFreeVars
precedence:
no precedence defined
result-values:
_
signature:
[(Prelude.Int, FlatCurry.Types.TypeExpr)]
-> FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr
-> Control.Monad.Trans.State.StateT TransState Prelude.IO ([(Prelude.Int, FlatCurry.Types.TypeExpr)], FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr)
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term