|
definition: |
optimizeFun :: [(QName,[QName])] -> [(QName,Bool)] -> FuncDecl
-> (Maybe QName,Int,Int,FuncDecl)
optimizeFun depinfo lininfo (Func qn ar vis ty (Rule vs e)) =
let (cyc,nsu,lnsu,opte) = optimizeExp (isDependent depinfo qn,lininfo) e
in (if cyc then Just qn else Nothing, nsu, lnsu,
Func qn ar vis ty (Rule vs opte))
optimizeFun _ _ (Func qn ar vis ty (External e)) =
(Nothing,0,0,Func qn ar vis ty (External e))
|
|
demand: |
argument 3 |
|
deterministic: |
deterministic operation |
|
documentation: |
Optimize a single function definition. The first argument is the list of all functions together with a flag whether they are defined by right-linear rules and functions. The result is (n,l,fd) where n is the number of non-strict equalities in the function definition, l is the number of optimized linear non-strict equalities, and fd is the optimized function definition. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,{Func}) |-> {(,,,)}}
|
|
name: |
optimizeFun |
|
precedence: |
no precedence defined |
|
result-values: |
{(,,,)}
|
|
signature: |
[((String, String), [(String, String)])] -> [((String, String), Prelude.Bool)] -> FlatCurry.Types.FuncDecl -> (Prelude.Maybe (String, String), Prelude.Int, Prelude.Int, FlatCurry.Types.FuncDecl) |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |