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

PlutusIR.Transform.KnownCon

Synopsis

Documentation

knownCon ∷ ∀ tyname name uni fun a. (HasUnique name TermUnique, HasUnique tyname TypeUnique, Eq name) ⇒ Term tyname name uni fun a → Term tyname name uni fun a Source #

Simplify destructor applications, if the scrutinee is a constructor application.

As an example, given

    Maybe_match
      {x_type}
      (Just {x_type} x)
      {result_type}
      (a -> : result_type)
      (: result_type)
      additional_args

knownCon turns it into

    (a -> just_case_body) x additional_args

knownConPass ∷ ∀ m uni fun a. (Typecheckable uni fun, GEq uni, Ord a, Applicative m) ⇒ PirTCConfig uni fun → Pass m TyName Name uni fun a Source #

knownConPassSC ∷ ∀ m uni fun a. (Typecheckable uni fun, GEq uni, Ord a, MonadQuote m) ⇒ PirTCConfig uni fun → Pass m TyName Name uni fun a Source #