plutus-core-1.45.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Transform.CaseOfCase.Test

Synopsis

Documentation

caseOfCase2Term Name DefaultUni DefaultFun () Source #

This should not simplify, because one of the branches of ifThenElse is not a Constr. Unless both branches are known constructors, the case-of-case transformation may increase the program size.

caseOfCase3Term Name DefaultUni DefaultFun () Source #

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).

caseOfCaseWithErrorTerm Name DefaultUni DefaultFun () Source #

  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 _|_))