CurryInfo: verify-non-fail-2.0.0 / Verify.ProgInfo.completeBranchesInFunc

definition: Info
 
completeBranchesInFunc :: [(QName,ConsInfo)] -> Bool -> FuncDecl -> FuncDecl
completeBranchesInFunc consinfos withanon = updFuncBody (updCases completeCase)
 where
  completeCase ct e brs = Case ct e $ case brs of
    []                           -> []
    Branch (LPattern _) _   : _  -> brs
    Branch (Pattern pc _) _ : bs -> brs ++
      let otherqs  = map ((\p -> (patCons p, length (patArgs p)))
                                    . branchPattern) bs
          siblings = siblingsOfCons consinfos pc
      in if withanon
           then if null (siblings \\ otherqs)
                  then []
                  else [Branch (Pattern anonCons []) fcFailed]
           else -- since the patterns variables are irrelevant, we use 100,...:
                map (\(qc,ar) -> Branch (Pattern qc (take ar [100..])) fcFailed)
                    (siblings \\ otherqs)
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
Complete all partial case branches occurring in the body of a function
by adding `Prelude.failed` branches. The first argument contains all data
constructors grouped by their data type. If the second argument is `True`,
only a single branch with an anonymous pattern is added (if necessary),
otherwise branches for all missing patterns are added.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,_) |-> _}
name: Info
 completeBranchesInFunc
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 [((String, String), (Prelude.Int, ConsType, [((String, String), Prelude.Int)]))]
-> Prelude.Bool -> FlatCurry.Types.FuncDecl -> FlatCurry.Types.FuncDecl
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term