CurryInfo: failfree-4.0.0 / Main.renamePatternVars

definition:
renamePatternVars :: TABranchExpr -> TransStateM TABranchExpr
renamePatternVars (ABranch p e) = do
  if isConsPattern p
    then do fv <- getFreshVarIndex
            let args = map fst (patArgs p)
                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)) (patArgs p)
            setFreshVarIndex (fv + maxarg - minarg + 1)
            addVarTypes nargs
            return $ ABranch (updPatArgs (map (\ (v,t) -> (rnm v,t))) p)
                             (rnmAllVars rnm e)
    else return $ ABranch p e
demand:
argument 1
deterministic:
deterministic operation
documentation:
-- Rename argument variables of constructor pattern
indeterministic:
referentially transparent operation
infix:
no fixity defined
name:
renamePatternVars
precedence:
no precedence defined
result-values:
_
signature:
FlatCurry.Annotated.Types.ABranchExpr FlatCurry.Types.TypeExpr
-> Control.Monad.Trans.State.StateT TransState Prelude.IO (FlatCurry.Annotated.Types.ABranchExpr FlatCurry.Types.TypeExpr)
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term