|
definition: |
transTester :: [(QName,ConsInfo)] -> QName -> Expr -> Expr
transTester consinfos qc exp
| qc == pre "True" = exp
| qc == pre "False" = fcNot exp
| qc == pre "[]" = Comb FuncCall (pre "null") [exp]
| qc == pre ":" = fcNot (Comb FuncCall (pre "null") [exp])
| otherwise
= Case Rigid exp
([Branch (Pattern qc (take arity [100..])) fcTrue] ++
if null siblings then [] else [Branch (Pattern anonCons []) fcFalse])
where
(arity,_,siblings) = infoOfCons consinfos qc
|
|
demand: |
argument 2 |
|
deterministic: |
deterministic operation |
|
documentation: |
Generate a test predicate for a given data constructor and an expression. generated by `Main.aCallType2Bool`. |
|
failfree: |
(_, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_) |-> _}
|
|
name: |
transTester |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
[((String, String), (Prelude.Int, Verify.ProgInfo.ConsType, [((String, String), Prelude.Int)]))] -> (String, String) -> FlatCurry.Types.Expr -> FlatCurry.Types.Expr |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |