| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Transform.CaseOfCase.Spec
Synopsis
- test_caseOfCase :: Constr. Unless both branches are known constructors, the case-of-case transformation may increase the program size.
| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Transform.CaseOfCase.Spec
caseOfCase3 :: DefaultFun () #
Similar to caseOfCase1, but the type of the true and false branches is
[Integer] rather than Bool (note that Constr 0 has two parameters, x and xs).
caseOfCaseWithError :: DefaultFun () #
case (force ifThenElse) True True False of
True -> ()
False -> _|_
Evaluates to () because the first case alternative is selected.
(The _|_ is not evaluated because case alternatives are evaluated lazily).
After the CaseOfCase transformation the program should evaluate to () as well.
force ((force ifThenElse) True (delay ()) (delay _|_))
testCaseOfCaseWithError :: DefaultFun () -> TestTree #