| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusCore.Annotation
Synopsis
- data Ann = Ann {}
- data SrcSpan = SrcSpan {
- srcSpanFile :: FilePath
- srcSpanSLine :: Int
- srcSpanSCol :: Int
- srcSpanELine :: Int
- srcSpanECol :: Int
- newtype SrcSpans = SrcSpans {
- unSrcSpans :: Set SrcSpan
- newtype InlineHints name a = InlineHints {
- shouldInline :: a -> name -> Inline
- data Inline
- class AnnInline a where
- annAlwaysInline :: a
- annSafeToInline :: a
- annMayInline :: a
- data Case
- class AnnCase a where
- annSafeToDrop :: a
- annNotSafeToDrop :: a
- annIsSafeToDrop :: a -> Bool
- data SourcePos = SourcePos {
- sourceName :: FilePath
- sourceLine :: !Pos
- sourceColumn :: !Pos
- data Pos
- addSrcSpan :: SrcSpan -> Ann -> Ann
- lineInSrcSpan :: Pos -> SrcSpan -> Bool
Documentation
An annotation type used during the compilation.
Constructors
| Ann | |
Fields
| |
Instances
| Generic Ann # | |
| Show Ann # | |
| Default Ann # | |
Defined in PlutusCore.Annotation | |
| Eq Ann # | |
| Ord Ann # | |
| Hashable Ann # | |
Defined in PlutusCore.Annotation | |
| AnnCase Ann # | |
Defined in PlutusCore.Annotation | |
| AnnInline Ann # | |
Defined in PlutusCore.Annotation | |
| Pretty Ann # | |
Defined in PlutusCore.Annotation | |
| type Rep Ann # | |
Defined in PlutusCore.Annotation type Rep Ann = D1 ('MetaData "Ann" "PlutusCore.Annotation" "plutus-core-1.60.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)))) | |
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
| |
newtype InlineHints name a #
Constructors
| InlineHints | |
Fields
| |
Instances
| Show (InlineHints name a) # | |
Defined in PlutusCore.Annotation Methods showsPrec :: Int -> InlineHints name a -> ShowS # show :: InlineHints name a -> String # showList :: [InlineHints name a] -> ShowS # | |
| Default (InlineHints name a) # | |
Defined in PlutusCore.Annotation Methods def :: InlineHints name a # | |
Constructors
| AlwaysInline | When calling This is currently used to ensure builtin functions such as |
| 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
| Generic Inline # | |
| Show Inline # | |
| Eq Inline # | |
| Ord Inline # | |
| Hashable Inline # | |
Defined in PlutusCore.Annotation | |
| type Rep Inline # | |
Defined in PlutusCore.Annotation type Rep Inline = D1 ('MetaData "Inline" "PlutusCore.Annotation" "plutus-core-1.60.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))) | |
Methods
annAlwaysInline :: a #
An annotation instructing the inliner to always inline a binding.
annSafeToInline :: a #
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 #
An annotation that leaves the inlining decision to the inliner.
Instances
| AnnInline Ann # | |
Defined in PlutusCore.Annotation | |
| AnnInline () # | |
Defined in PlutusCore.Annotation | |
Constructors
| SafeToDrop | Signaling to the compiler that a |
| NotSafeToDrop |
Methods used to guide optimization of case expressions.
Methods
annSafeToDrop :: a #
An annotation signaling that the case expression is safe to drop,
so long as its binders are unused.
annNotSafeToDrop :: a #
annIsSafeToDrop :: a -> Bool #
Instances
| AnnCase Ann # | |
Defined in PlutusCore.Annotation | |
| AnnCase () # | |
Defined in PlutusCore.Annotation | |
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
| |
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
lineInSrcSpan :: Pos -> SrcSpan -> Bool #
Tells if a line (positive integer) falls inside a SrcSpan.