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

PlutusCore.Annotation

Synopsis

Documentation

data Ann Source #

An annotation type used during the compilation.

Constructors

Ann 

Instances

Instances details
Generic Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Associated Types

type Rep Ann ∷ Type → Type Source #

Methods

from ∷ Ann → Rep Ann x Source #

to ∷ Rep Ann x → Ann Source #

Show Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

showsPrec ∷ Int → Ann → ShowS Source #

show ∷ Ann → String Source #

showList ∷ [Ann] → ShowS Source #

Default Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

def ∷ Ann #

Eq Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

(==) ∷ Ann → Ann → Bool Source #

(/=) ∷ Ann → Ann → Bool Source #

Ord Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

compare ∷ Ann → Ann → Ordering Source #

(<) ∷ Ann → Ann → Bool Source #

(<=) ∷ Ann → Ann → Bool Source #

(>) ∷ Ann → Ann → Bool Source #

(>=) ∷ Ann → Ann → Bool Source #

max ∷ Ann → Ann → Ann Source #

min ∷ Ann → Ann → Ann Source #

Hashable Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSalt ∷ Int → Ann → Int Source #

hash ∷ Ann → Int Source #

AnnCase Ann Source # 
Instance details

Defined in PlutusCore.Annotation

AnnInline Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Pretty Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

pretty ∷ Ann → Doc ann Source #

prettyList ∷ [Ann] → Doc ann Source #

type Rep Ann Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep Ann = D1 ('MetaData "Ann" "PlutusCore.Annotation" "plutus-core-1.69.0.0-inplace" 'False) (C1 ('MetaCons "Ann" 'PrefixI 'True) ((S1 ('MetaSel ('Just "annInline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Inline) :*: S1 ('MetaSel ('Just "annCase") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Case)) :*: (S1 ('MetaSel ('Just "annSrcSpans") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SrcSpans) :*: S1 ('MetaSel ('Just "annIsAsDataMatcher") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

data SrcSpan Source #

The span between two source locations.

This corresponds roughly to the SrcSpan used by GHC, but we define our own version so we don't have to depend on ghc to use it.

The line and column numbers are 1-based, and the unit is Unicode code point (or Char).

Constructors

SrcSpan 

Fields

Instances

Instances details
Generic SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Associated Types

type Rep SrcSpan ∷ Type → Type Source #

Methods

from ∷ SrcSpan → Rep SrcSpan x Source #

to ∷ Rep SrcSpan x → SrcSpan Source #

Show SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

NFData SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

rnf ∷ SrcSpan → () Source #

Eq SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

(==) ∷ SrcSpan → SrcSpan → Bool Source #

(/=) ∷ SrcSpan → SrcSpan → Bool Source #

Ord SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Hashable SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSalt ∷ Int → SrcSpan → Int Source #

hash ∷ SrcSpan → Int Source #

Flat SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Pretty SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

pretty ∷ SrcSpan → Doc ann Source #

prettyList ∷ [SrcSpan] → Doc ann Source #

Exception (UniqueError SrcSpan) Source # 
Instance details

Defined in PlutusCore.Error

type Rep SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep SrcSpan = D1 ('MetaData "SrcSpan" "PlutusCore.Annotation" "plutus-core-1.69.0.0-inplace" 'False) (C1 ('MetaCons "SrcSpan" 'PrefixI 'True) ((S1 ('MetaSel ('Just "srcSpanFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "srcSpanSLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "srcSpanSCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "srcSpanELine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "srcSpanECol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))))

newtype SrcSpans Source #

Constructors

SrcSpans 

Fields

Instances

Instances details
Monoid SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Semigroup SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Generic SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Associated Types

type Rep SrcSpans ∷ Type → Type Source #

Show SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

NFData SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

rnf ∷ SrcSpans → () Source #

Eq SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Ord SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Hashable SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

MonoFoldable SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

ofoldMap ∷ Monoid m ⇒ (Element SrcSpans → m) → SrcSpans → m Source #

ofoldr ∷ (Element SrcSpans → b → b) → b → SrcSpans → b Source #

ofoldl' ∷ (a → Element SrcSpans → a) → a → SrcSpans → a Source #

otoList ∷ SrcSpans → [Element SrcSpans] Source #

oall ∷ (Element SrcSpans → Bool) → SrcSpans → Bool Source #

oany ∷ (Element SrcSpans → Bool) → SrcSpans → Bool Source #

onull ∷ SrcSpans → Bool Source #

olength ∷ SrcSpans → Int Source #

olength64 ∷ SrcSpans → Int64 Source #

ocompareLength ∷ Integral i ⇒ SrcSpans → i → Ordering Source #

otraverse_ ∷ Applicative f ⇒ (Element SrcSpans → f b) → SrcSpans → f () Source #

ofor_ ∷ Applicative f ⇒ SrcSpans → (Element SrcSpans → f b) → f () Source #

omapM_ ∷ Applicative m ⇒ (Element SrcSpans → m ()) → SrcSpans → m () Source #

oforM_ ∷ Applicative m ⇒ SrcSpans → (Element SrcSpans → m ()) → m () Source #

ofoldlM ∷ Monad m ⇒ (a → Element SrcSpans → m a) → a → SrcSpans → m a Source #

ofoldMap1Ex ∷ Semigroup m ⇒ (Element SrcSpans → m) → SrcSpans → m Source #

ofoldr1Ex ∷ (Element SrcSpans → Element SrcSpans → Element SrcSpans) → SrcSpans → Element SrcSpans Source #

ofoldl1Ex' ∷ (Element SrcSpans → Element SrcSpans → Element SrcSpans) → SrcSpans → Element SrcSpans Source #

headEx ∷ SrcSpans → Element SrcSpans Source #

lastEx ∷ SrcSpans → Element SrcSpans Source #

unsafeHead ∷ SrcSpans → Element SrcSpans Source #

unsafeLast ∷ SrcSpans → Element SrcSpans Source #

maximumByEx ∷ (Element SrcSpans → Element SrcSpans → Ordering) → SrcSpans → Element SrcSpans Source #

minimumByEx ∷ (Element SrcSpans → Element SrcSpans → Ordering) → SrcSpans → Element SrcSpans Source #

oelem ∷ Element SrcSpans → SrcSpans → Bool Source #

onotElem ∷ Element SrcSpans → SrcSpans → Bool Source #

Flat SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Pretty SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

pretty ∷ SrcSpans → Doc ann Source #

prettyList ∷ [SrcSpans] → Doc ann Source #

type Rep SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep SrcSpans = D1 ('MetaData "SrcSpans" "PlutusCore.Annotation" "plutus-core-1.69.0.0-inplace" 'True) (C1 ('MetaCons "SrcSpans" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSrcSpans") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set SrcSpan))))
type Element SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

newtype InlineHints name a Source #

Constructors

InlineHints 

Fields

Instances

Instances details
Show (InlineHints name a) Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

showsPrec ∷ Int → InlineHints name a → ShowS Source #

show ∷ InlineHints name a → String Source #

showList ∷ [InlineHints name a] → ShowS Source #

Default (InlineHints name a) Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

def ∷ InlineHints name a #

data Inline Source #

Constructors

AlwaysInline

When calling PlutusIR.Compiler.Definitions.defineTerm to add a new term definition, if we annotation the var on the LHS of the definition with AlwaysInline, the inliner will always inline that var.

This is currently used to ensure builtin functions such as trace (when the remove-trace flag is on and trace is rewritten to const) are inlined, because the inliner would otherwise not inline them. To achieve that, we annotate the definition with AlwaysInline when defining trace, i.e., trace AlwaysInline = _ a -> a.

SafeToInline

Signaling to the compiler that a binding is safe to inline. This is useful for annotating strict bindings that aren't obviously safe to inline.

MayInline 

Instances

Instances details
Generic Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Associated Types

type Rep Inline ∷ Type → Type Source #

Methods

from ∷ Inline → Rep Inline x Source #

to ∷ Rep Inline x → Inline Source #

Show Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Eq Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

(==) ∷ Inline → Inline → Bool Source #

(/=) ∷ Inline → Inline → Bool Source #

Ord Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Hashable Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSalt ∷ Int → Inline → Int Source #

hash ∷ Inline → Int Source #

type Rep Inline Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep Inline = D1 ('MetaData "Inline" "PlutusCore.Annotation" "plutus-core-1.69.0.0-inplace" 'False) (C1 ('MetaCons "AlwaysInline" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "SafeToInline" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "MayInline" 'PrefixI 'False) (U1 ∷ Type → Type)))

class AnnInline a where Source #

Methods

annAlwaysInline ∷ a Source #

An annotation instructing the inliner to always inline a binding.

annSafeToInline ∷ a Source #

An annotation signaling to the inliner that a binding is safe to inline. The inlining decision is left to the inliner. This is useful for annotating strict bindings that aren't obviously safe to inline.

annMayInline ∷ a Source #

An annotation that leaves the inlining decision to the inliner.

Instances

Instances details
AnnInline Ann Source # 
Instance details

Defined in PlutusCore.Annotation

AnnInline () Source # 
Instance details

Defined in PlutusCore.Annotation

data Case Source #

Constructors

SafeToDrop

Signaling to the compiler that a case expression is safe to drop, so long as its binders are unused.

NotSafeToDrop 

Instances

Instances details
Generic Case Source # 
Instance details

Defined in PlutusCore.Annotation

Associated Types

type Rep Case ∷ Type → Type Source #

Methods

from ∷ Case → Rep Case x Source #

to ∷ Rep Case x → Case Source #

Show Case Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

showsPrec ∷ Int → Case → ShowS Source #

show ∷ Case → String Source #

showList ∷ [Case] → ShowS Source #

Eq Case Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

(==) ∷ Case → Case → Bool Source #

(/=) ∷ Case → Case → Bool Source #

Ord Case Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

compare ∷ Case → Case → Ordering Source #

(<) ∷ Case → Case → Bool Source #

(<=) ∷ Case → Case → Bool Source #

(>) ∷ Case → Case → Bool Source #

(>=) ∷ Case → Case → Bool Source #

max ∷ Case → Case → Case Source #

min ∷ Case → Case → Case Source #

Hashable Case Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSalt ∷ Int → Case → Int Source #

hash ∷ Case → Int Source #

type Rep Case Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep Case = D1 ('MetaData "Case" "PlutusCore.Annotation" "plutus-core-1.69.0.0-inplace" 'False) (C1 ('MetaCons "SafeToDrop" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "NotSafeToDrop" 'PrefixI 'False) (U1 ∷ Type → Type))

class AnnCase a where Source #

Methods used to guide optimization of case expressions.

Methods

annSafeToDrop ∷ a Source #

An annotation signaling that the case expression is safe to drop, so long as its binders are unused.

annNotSafeToDrop ∷ a Source #

annIsSafeToDrop ∷ a → Bool Source #

Instances

Instances details
AnnCase Ann Source # 
Instance details

Defined in PlutusCore.Annotation

AnnCase () Source # 
Instance details

Defined in PlutusCore.Annotation

data SourcePos Source #

The data type SourcePos represents source positions. It contains the name of the source file, a line number, and a column number. Source line and column positions change intensively during parsing, so we need to make them strict to avoid memory leaks.

Constructors

SourcePos 

Fields

Instances

Instances details
Data SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → SourcePos → c SourcePos Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c SourcePos Source #

toConstr ∷ SourcePos → Constr Source #

dataTypeOf ∷ SourcePos → DataType Source #

dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c SourcePos) Source #

dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c SourcePos) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → SourcePos → SourcePos Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → SourcePos → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → SourcePos → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → SourcePos → [u] Source #

gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → SourcePos → u Source #

gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → SourcePos → m SourcePos Source #

gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → SourcePos → m SourcePos Source #

gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → SourcePos → m SourcePos Source #

Generic SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Associated Types

type Rep SourcePos ∷ Type → Type Source #

Read SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Show SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

NFData SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

rnf ∷ SourcePos → () Source #

Eq SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Ord SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Pretty SourcePos Source # 
Instance details

Defined in PlutusCore.Error

Methods

pretty ∷ SourcePos → Doc ann Source #

prettyList ∷ [SourcePos] → Doc ann Source #

type Rep SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

type Rep SourcePos = D1 ('MetaData "SourcePos" "Text.Megaparsec.Pos" "megaparsec-9.7.1-5nEOov396T0Kx8yujQDoUA" 'False) (C1 ('MetaCons "SourcePos" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "sourceLine") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos) :*: S1 ('MetaSel ('Just "sourceColumn") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos))))

data Pos Source #

Pos is the type for positive integers. This is used to represent line number, column number, and similar things like indentation level. Semigroup instance can be used to safely and efficiently add Poses together.

Since: megaparsec-5.0.0

Instances

Instances details
Data Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Pos → c Pos Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Pos Source #

toConstr ∷ Pos → Constr Source #

dataTypeOf ∷ Pos → DataType Source #

dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c Pos) Source #

dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c Pos) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → Pos → Pos Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → Pos → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → Pos → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → Pos → [u] Source #

gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → Pos → u Source #

gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → Pos → m Pos Source #

gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Pos → m Pos Source #

gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Pos → m Pos Source #

Semigroup Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

(<>) ∷ Pos → Pos → Pos Source #

sconcat ∷ NonEmpty Pos → Pos Source #

stimes ∷ Integral b ⇒ b → Pos → Pos Source #

Generic Pos 
Instance details

Defined in Text.Megaparsec.Pos

Associated Types

type Rep Pos ∷ Type → Type Source #

Methods

from ∷ Pos → Rep Pos x Source #

to ∷ Rep Pos x → Pos Source #

Read Pos 
Instance details

Defined in Text.Megaparsec.Pos

Show Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

showsPrec ∷ Int → Pos → ShowS Source #

show ∷ Pos → String Source #

showList ∷ [Pos] → ShowS Source #

NFData Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

rnf ∷ Pos → () Source #

Eq Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

(==) ∷ Pos → Pos → Bool Source #

(/=) ∷ Pos → Pos → Bool Source #

Ord Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

compare ∷ Pos → Pos → Ordering Source #

(<) ∷ Pos → Pos → Bool Source #

(<=) ∷ Pos → Pos → Bool Source #

(>) ∷ Pos → Pos → Bool Source #

(>=) ∷ Pos → Pos → Bool Source #

max ∷ Pos → Pos → Pos Source #

min ∷ Pos → Pos → Pos Source #

type Rep Pos 
Instance details

Defined in Text.Megaparsec.Pos

type Rep Pos = D1 ('MetaData "Pos" "Text.Megaparsec.Pos" "megaparsec-9.7.1-5nEOov396T0Kx8yujQDoUA" 'True) (C1 ('MetaCons "Pos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

addSrcSpan ∷ SrcSpan → Ann → Ann Source #

Add an extra SrcSpan to existing SrcSpans of Ann

lineInSrcSpan ∷ Pos → SrcSpan → Bool Source #

Tells if a line (positive integer) falls inside a SrcSpan.