plutus-core-1.36.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

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

hash :: Ann -> Int

Pretty Ann Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

pretty :: Ann -> Doc ann #

prettyList :: [Ann] -> Doc ann #

type Rep Ann Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep Ann = D1 ('MetaData "Ann" "PlutusCore.Annotation" "plutus-core-1.36.0.0-7ehJj5tIPqoJIiiivXkX9N" 'False) (C1 ('MetaCons "Ann" 'PrefixI 'True) (S1 ('MetaSel ('Just "annInline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Inline) :*: S1 ('MetaSel ('Just "annSrcSpans") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SrcSpans)))

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 #

Show SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

NFData SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

rnf :: SrcSpan -> () Source #

Flat SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

encode :: SrcSpan -> Encoding

decode :: Get SrcSpan

size :: SrcSpan -> NumBits -> NumBits

Eq SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Ord SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Hashable SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSalt :: Int -> SrcSpan -> Int

hash :: SrcSpan -> Int

Pretty SrcSpan Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

pretty :: SrcSpan -> Doc ann #

prettyList :: [SrcSpan] -> Doc ann #

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.36.0.0-7ehJj5tIPqoJIiiivXkX9N" '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 

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 #

Flat SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

encode :: SrcSpans -> Encoding

decode :: Get SrcSpans

size :: SrcSpans -> NumBits -> NumBits

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

ofoldr :: (Element SrcSpans -> b -> b) -> b -> SrcSpans -> b

ofoldl' :: (a -> Element SrcSpans -> a) -> a -> SrcSpans -> a

otoList :: SrcSpans -> [Element SrcSpans]

oall :: (Element SrcSpans -> Bool) -> SrcSpans -> Bool

oany :: (Element SrcSpans -> Bool) -> SrcSpans -> Bool

onull :: SrcSpans -> Bool

olength :: SrcSpans -> Int

olength64 :: SrcSpans -> Int64

ocompareLength :: Integral i => SrcSpans -> i -> Ordering

otraverse_ :: Applicative f => (Element SrcSpans -> f b) -> SrcSpans -> f ()

ofor_ :: Applicative f => SrcSpans -> (Element SrcSpans -> f b) -> f ()

omapM_ :: Applicative m => (Element SrcSpans -> m ()) -> SrcSpans -> m ()

oforM_ :: Applicative m => SrcSpans -> (Element SrcSpans -> m ()) -> m ()

ofoldlM :: Monad m => (a -> Element SrcSpans -> m a) -> a -> SrcSpans -> m a

ofoldMap1Ex :: Semigroup m => (Element SrcSpans -> m) -> SrcSpans -> m

ofoldr1Ex :: (Element SrcSpans -> Element SrcSpans -> Element SrcSpans) -> SrcSpans -> Element SrcSpans

ofoldl1Ex' :: (Element SrcSpans -> Element SrcSpans -> Element SrcSpans) -> SrcSpans -> Element SrcSpans

headEx :: SrcSpans -> Element SrcSpans

lastEx :: SrcSpans -> Element SrcSpans

unsafeHead :: SrcSpans -> Element SrcSpans

unsafeLast :: SrcSpans -> Element SrcSpans

maximumByEx :: (Element SrcSpans -> Element SrcSpans -> Ordering) -> SrcSpans -> Element SrcSpans

minimumByEx :: (Element SrcSpans -> Element SrcSpans -> Ordering) -> SrcSpans -> Element SrcSpans

oelem :: Element SrcSpans -> SrcSpans -> Bool

onotElem :: Element SrcSpans -> SrcSpans -> Bool

Pretty SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

pretty :: SrcSpans -> Doc ann #

prettyList :: [SrcSpans] -> Doc ann #

type Rep SrcSpans Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep SrcSpans = D1 ('MetaData "SrcSpans" "PlutusCore.Annotation" "plutus-core-1.36.0.0-7ehJj5tIPqoJIiiivXkX9N" '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

type Element SrcSpans = SrcSpan

newtype InlineHints name a Source #

Constructors

InlineHints 

Fields

Instances

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

Defined in PlutusCore.Annotation

Methods

mempty :: InlineHints name a Source #

mappend :: InlineHints name a -> InlineHints name a -> InlineHints name a Source #

mconcat :: [InlineHints name a] -> InlineHints name a Source #

Semigroup (InlineHints name a) Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

(<>) :: InlineHints name a -> InlineHints name a -> InlineHints name a Source #

sconcat :: NonEmpty (InlineHints name a) -> InlineHints name a Source #

stimes :: Integral b => b -> InlineHints name a -> InlineHints name a Source #

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 #

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.

MayInline 

Instances

Instances details
Generic Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Associated Types

type Rep Inline :: Type -> Type Source #

Show Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Eq Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Ord Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Hashable Inline Source # 
Instance details

Defined in PlutusCore.Annotation

Methods

hashWithSalt :: Int -> Inline -> Int

hash :: Inline -> Int

type Rep Inline Source # 
Instance details

Defined in PlutusCore.Annotation

type Rep Inline = D1 ('MetaData "Inline" "PlutusCore.Annotation" "plutus-core-1.36.0.0-7ehJj5tIPqoJIiiivXkX9N" 'False) (C1 ('MetaCons "AlwaysInline" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MayInline" 'PrefixI 'False) (U1 :: Type -> Type))

annMayInline :: Ann Source #

Create an Ann with MayInline.

data SourcePos #

Constructors

SourcePos 

Instances

Instances details
Data SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos Source #

toConstr :: SourcePos -> Constr Source #

dataTypeOf :: SourcePos -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos) Source #

gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

gmapMo :: MonadPlus m => (forall 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 #

prettyList :: [SourcePos] -> Doc ann #

type Rep SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

type Rep SourcePos = D1 ('MetaData "SourcePos" "Text.Megaparsec.Pos" "megaparsec-9.6.1-2y4TSvMYdIdIGL4Xdwvkcx" '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 #

Instances

Instances details
Data Pos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pos -> c Pos Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pos Source #

toConstr :: Pos -> Constr Source #

dataTypeOf :: Pos -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pos) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pos) Source #

gmapT :: (forall b. Data b => b -> b) -> Pos -> Pos Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pos -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pos -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Pos -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Pos -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pos -> m Pos Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pos -> m Pos Source #

gmapMo :: MonadPlus m => (forall 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

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.6.1-2y4TSvMYdIdIGL4Xdwvkcx" '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.