Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ParserError
- class AsParserErrorBundle r where
- _ParserErrorBundle ∷ Prism' r ParserErrorBundle
- _ParseErrorB ∷ Prism' r (ParseErrorBundle Text ParserError)
- data ParserErrorBundle = ParseErrorB !(ParseErrorBundle Text ParserError)
- data NormCheckError tyname name uni fun ann
- class AsNormCheckError r tyname name uni fun ann | r → tyname name uni fun ann where
- _NormCheckError ∷ Prism' r (NormCheckError tyname name uni fun ann)
- _BadType ∷ Prism' r (ann, Type tyname uni ann, Text)
- _BadTerm ∷ Prism' r (ann, Term tyname name uni fun ann, Text)
- data UniqueError ann
- = MultiplyDefined !Unique !ann !ann
- | IncoherentUsage !Unique !ann !ann
- | FreeVariable !Unique !ann
- class AsUniqueError r ann | r → ann where
- _UniqueError ∷ Prism' r (UniqueError ann)
- _MultiplyDefined ∷ Prism' r (Unique, ann, ann)
- _IncoherentUsage ∷ Prism' r (Unique, ann, ann)
- _FreeVariable ∷ Prism' r (Unique, ann)
- data ExpectedShapeOr a
- = ExpectedShape !Text ![Text]
- | ExpectedExact !a
- data TypeError term uni fun ann
- = KindMismatch !ann !(Type TyName uni ()) !(ExpectedShapeOr (Kind ())) !(Kind ())
- | TypeMismatch !ann !term !(ExpectedShapeOr (Type TyName uni ())) !(Normalized (Type TyName uni ()))
- | TyNameMismatch !ann !TyName !TyName
- | NameMismatch !ann !Name !Name
- | FreeTypeVariableE !ann !TyName
- | FreeVariableE !ann !Name
- | UnknownBuiltinFunctionE !ann !fun
- class AsTypeError r term uni fun ann | r → term uni fun ann where
- _TypeError ∷ Prism' r (TypeError term uni fun ann)
- _KindMismatch ∷ Prism' r (ann, Type TyName uni (), ExpectedShapeOr (Kind ()), Kind ())
- _TypeMismatch ∷ Prism' r (ann, term, ExpectedShapeOr (Type TyName uni ()), Normalized (Type TyName uni ()))
- _TyNameMismatch ∷ Prism' r (ann, TyName, TyName)
- _NameMismatch ∷ Prism' r (ann, Name, Name)
- _FreeTypeVariableE ∷ Prism' r (ann, TyName)
- _FreeVariableE ∷ Prism' r (ann, Name)
- _UnknownBuiltinFunctionE ∷ Prism' r (ann, fun)
- data FreeVariableError
- = FreeUnique !Unique
- | FreeIndex !Index
- class AsFreeVariableError r where
- _FreeVariableError ∷ Prism' r FreeVariableError
- _FreeUnique ∷ Prism' r Unique
- _FreeIndex ∷ Prism' r Index
- data Error uni fun ann
- = ParseErrorE !ParserErrorBundle
- | UniqueCoherencyErrorE !(UniqueError ann)
- | TypeErrorE !(TypeError (Term TyName Name uni fun ()) uni fun ann)
- | NormCheckErrorE !(NormCheckError TyName Name uni fun ann)
- | FreeVariableErrorE !FreeVariableError
- class AsError r uni fun ann | r → uni fun ann where
- _Error ∷ Prism' r (Error uni fun ann)
- _ParseErrorE ∷ Prism' r ParserErrorBundle
- _UniqueCoherencyErrorE ∷ Prism' r (UniqueError ann)
- _TypeErrorE ∷ Prism' r (TypeError (Term TyName Name uni fun ()) uni fun ann)
- _NormCheckErrorE ∷ Prism' r (NormCheckError TyName Name uni fun ann)
- _FreeVariableErrorE ∷ Prism' r FreeVariableError
- throwingEither ∷ MonadError e m ⇒ AReview e t → Either t a → m a
- class Ord a ⇒ ShowErrorComponent a where
- showErrorComponent ∷ a → String
- errorComponentLen ∷ a → Int
- data ApplyProgramError = MkApplyProgramError Version Version
Documentation
data ParserError Source #
An error encountered during parsing.
BuiltinTypeNotAStar !Text !SourcePos | |
UnknownBuiltinFunction !Text !SourcePos ![Text] | |
InvalidBuiltinConstant !Text !Text !SourcePos |
Instances
class AsParserErrorBundle r where Source #
_ParserErrorBundle ∷ Prism' r ParserErrorBundle Source #
_ParseErrorB ∷ Prism' r (ParseErrorBundle Text ParserError) Source #
Instances
AsParserErrorBundle ParserErrorBundle Source # | |
Defined in PlutusCore.Error | |
AsParserErrorBundle (Error uni fun ann) Source # | |
Defined in PlutusCore.Error _ParserErrorBundle ∷ Prism' (Error uni fun ann) ParserErrorBundle Source # _ParseErrorB ∷ Prism' (Error uni fun ann) (ParseErrorBundle Text ParserError) Source # |
data ParserErrorBundle Source #
Instances
Generic ParserErrorBundle Source # | |
Defined in PlutusCore.Error | |
Show ParserErrorBundle Source # | |
Defined in PlutusCore.Error | |
NFData ParserErrorBundle Source # | |
Defined in PlutusCore.Error rnf ∷ ParserErrorBundle → () Source # | |
Eq ParserErrorBundle Source # | |
Defined in PlutusCore.Error | |
AsParserErrorBundle ParserErrorBundle Source # | |
Defined in PlutusCore.Error | |
Pretty ParserErrorBundle Source # | |
Defined in PlutusCore.Error pretty ∷ ParserErrorBundle → Doc ann Source # prettyList ∷ [ParserErrorBundle] → Doc ann Source # | |
type Rep ParserErrorBundle Source # | |
Defined in PlutusCore.Error type Rep ParserErrorBundle = D1 ('MetaData "ParserErrorBundle" "PlutusCore.Error" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "ParseErrorB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ParseErrorBundle Text ParserError)))) |
data NormCheckError tyname name uni fun ann Source #
Instances
(Pretty ann, PrettyBy config (Type tyname uni ann), PrettyBy config (Term tyname name uni fun ann)) ⇒ PrettyBy config (NormCheckError tyname name uni fun ann) Source # | |
Defined in PlutusCore.Error prettyBy ∷ config → NormCheckError tyname name uni fun ann → Doc ann0 Source # prettyListBy ∷ config → [NormCheckError tyname name uni fun ann] → Doc ann0 Source # | |
Functor (NormCheckError tyname name uni fun) Source # | |
Defined in PlutusCore.Error fmap ∷ (a → b) → NormCheckError tyname name uni fun a → NormCheckError tyname name uni fun b Source # (<$) ∷ a → NormCheckError tyname name uni fun b → NormCheckError tyname name uni fun a Source # | |
Generic (NormCheckError tyname name uni fun ann) Source # | |
Defined in PlutusCore.Error from ∷ NormCheckError tyname name uni fun ann → Rep (NormCheckError tyname name uni fun ann) x Source # to ∷ Rep (NormCheckError tyname name uni fun ann) x → NormCheckError tyname name uni fun ann Source # | |
(Show tyname, Show name, Closed uni, Everywhere uni Show, Show fun, Show ann, GShow uni) ⇒ Show (NormCheckError tyname name uni fun ann) Source # | |
Defined in PlutusCore.Error | |
(NFData tyname, NFData name, Closed uni, Everywhere uni NFData, NFData fun, NFData ann) ⇒ NFData (NormCheckError tyname name uni fun ann) Source # | |
Defined in PlutusCore.Error rnf ∷ NormCheckError tyname name uni fun ann → () Source # | |
(Eq (Term tyname name uni fun ann), Eq (Type tyname uni ann), GEq uni, Closed uni, Everywhere uni Eq, Eq fun, Eq ann) ⇒ Eq (NormCheckError tyname name uni fun ann) Source # | |
Defined in PlutusCore.Error (==) ∷ NormCheckError tyname name uni fun ann → NormCheckError tyname name uni fun ann → Bool Source # (/=) ∷ NormCheckError tyname name uni fun ann → NormCheckError tyname name uni fun ann → Bool Source # | |
AsNormCheckError (NormCheckError tyname name uni fun ann) tyname name uni fun ann Source # | |
Defined in PlutusCore.Error _NormCheckError ∷ Prism' (NormCheckError tyname name uni fun ann) (NormCheckError tyname name uni fun ann) Source # _BadType ∷ Prism' (NormCheckError tyname name uni fun ann) (ann, Type tyname uni ann, Text) Source # _BadTerm ∷ Prism' (NormCheckError tyname name uni fun ann) (ann, Term tyname name uni fun ann, Text) Source # | |
type Rep (NormCheckError tyname name uni fun ann) Source # | |
Defined in PlutusCore.Error type Rep (NormCheckError tyname name uni fun ann) = D1 ('MetaData "NormCheckError" "PlutusCore.Error" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "BadType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ann) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Type tyname uni ann)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) :+: C1 ('MetaCons "BadTerm" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ann) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Term tyname name uni fun ann)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))) |
class AsNormCheckError r tyname name uni fun ann | r → tyname name uni fun ann where Source #
_NormCheckError ∷ Prism' r (NormCheckError tyname name uni fun ann) Source #
_BadType ∷ Prism' r (ann, Type tyname uni ann, Text) Source #
_BadTerm ∷ Prism' r (ann, Term tyname name uni fun ann, Text) Source #
Instances
(tyname ~ TyName, name ~ Name) ⇒ AsNormCheckError (Error uni fun ann) tyname name uni fun ann Source # | |
AsNormCheckError (NormCheckError tyname name uni fun ann) tyname name uni fun ann Source # | |
Defined in PlutusCore.Error _NormCheckError ∷ Prism' (NormCheckError tyname name uni fun ann) (NormCheckError tyname name uni fun ann) Source # _BadType ∷ Prism' (NormCheckError tyname name uni fun ann) (ann, Type tyname uni ann, Text) Source # _BadTerm ∷ Prism' (NormCheckError tyname name uni fun ann) (ann, Term tyname name uni fun ann, Text) Source # |
data UniqueError ann Source #
MultiplyDefined !Unique !ann !ann | |
IncoherentUsage !Unique !ann !ann | |
FreeVariable !Unique !ann |
Instances
class AsUniqueError r ann | r → ann where Source #
_UniqueError ∷ Prism' r (UniqueError ann) Source #
_MultiplyDefined ∷ Prism' r (Unique, ann, ann) Source #
_IncoherentUsage ∷ Prism' r (Unique, ann, ann) Source #
_FreeVariable ∷ Prism' r (Unique, ann) Source #
Instances
AsUniqueError (UniqueError ann) ann Source # | |
Defined in PlutusCore.Error _UniqueError ∷ Prism' (UniqueError ann) (UniqueError ann) Source # _MultiplyDefined ∷ Prism' (UniqueError ann) (Unique, ann, ann) Source # _IncoherentUsage ∷ Prism' (UniqueError ann) (Unique, ann, ann) Source # _FreeVariable ∷ Prism' (UniqueError ann) (Unique, ann) Source # | |
AsUniqueError (Error uni fun ann) ann Source # | |
Defined in PlutusCore.Error _UniqueError ∷ Prism' (Error uni fun ann) (UniqueError ann) Source # _MultiplyDefined ∷ Prism' (Error uni fun ann) (Unique, ann, ann) Source # _IncoherentUsage ∷ Prism' (Error uni fun ann) (Unique, ann, ann) Source # _FreeVariable ∷ Prism' (Error uni fun ann) (Unique, ann) Source # |
data ExpectedShapeOr a Source #
This is needed for nice kind/type checking error messages. In some cases the type checker knows
the exact type that an expression has to have for type checking to succeed (see any of
checkTypeM
functions and its usages), which is what ExpectedExact
is suitable for. In other
cases the type checker only cares about the shape of the inferred type, e.g. the type checker
knows that the type of a function has to be dom -> cod
for type checking to succeed, but it
doesn't yet care what dom
and cod
exactly are. Which is what ExpectedShape
is useful for as
it allows one to specify the shape of an expected type with some existential variables in it when
it's impossible to provide an exact type.
Instances
data TypeError term uni fun ann Source #
KindMismatch | |
| |
TypeMismatch | |
| |
TyNameMismatch !ann !TyName !TyName | |
NameMismatch !ann !Name !Name | |
FreeTypeVariableE !ann !TyName | |
FreeVariableE !ann !Name | |
UnknownBuiltinFunctionE !ann !fun |
Instances
class AsTypeError r term uni fun ann | r → term uni fun ann where Source #
_TypeError ∷ Prism' r (TypeError term uni fun ann) Source #
_KindMismatch ∷ Prism' r (ann, Type TyName uni (), ExpectedShapeOr (Kind ()), Kind ()) Source #
_TypeMismatch ∷ Prism' r (ann, term, ExpectedShapeOr (Type TyName uni ()), Normalized (Type TyName uni ())) Source #
_TyNameMismatch ∷ Prism' r (ann, TyName, TyName) Source #
_NameMismatch ∷ Prism' r (ann, Name, Name) Source #
_FreeTypeVariableE ∷ Prism' r (ann, TyName) Source #
_FreeVariableE ∷ Prism' r (ann, Name) Source #
_UnknownBuiltinFunctionE ∷ Prism' r (ann, fun) Source #
Instances
AsTypeError (Error uni fun ann) (Term TyName Name uni fun ()) uni fun ann Source # | |
Defined in PlutusCore.Error _TypeError ∷ Prism' (Error uni fun ann) (TypeError (Term TyName Name uni fun ()) uni fun ann) Source # _KindMismatch ∷ Prism' (Error uni fun ann) (ann, Type TyName uni (), ExpectedShapeOr (Kind ()), Kind ()) Source # _TypeMismatch ∷ Prism' (Error uni fun ann) (ann, Term TyName Name uni fun (), ExpectedShapeOr (Type TyName uni ()), Normalized (Type TyName uni ())) Source # _TyNameMismatch ∷ Prism' (Error uni fun ann) (ann, TyName, TyName) Source # _NameMismatch ∷ Prism' (Error uni fun ann) (ann, Name, Name) Source # _FreeTypeVariableE ∷ Prism' (Error uni fun ann) (ann, TyName) Source # _FreeVariableE ∷ Prism' (Error uni fun ann) (ann, Name) Source # _UnknownBuiltinFunctionE ∷ Prism' (Error uni fun ann) (ann, fun) Source # | |
AsTypeError (TypeError term uni fun ann) term uni fun ann Source # | |
Defined in PlutusCore.Error _TypeError ∷ Prism' (TypeError term uni fun ann) (TypeError term uni fun ann) Source # _KindMismatch ∷ Prism' (TypeError term uni fun ann) (ann, Type TyName uni (), ExpectedShapeOr (Kind ()), Kind ()) Source # _TypeMismatch ∷ Prism' (TypeError term uni fun ann) (ann, term, ExpectedShapeOr (Type TyName uni ()), Normalized (Type TyName uni ())) Source # _TyNameMismatch ∷ Prism' (TypeError term uni fun ann) (ann, TyName, TyName) Source # _NameMismatch ∷ Prism' (TypeError term uni fun ann) (ann, Name, Name) Source # _FreeTypeVariableE ∷ Prism' (TypeError term uni fun ann) (ann, TyName) Source # _FreeVariableE ∷ Prism' (TypeError term uni fun ann) (ann, Name) Source # _UnknownBuiltinFunctionE ∷ Prism' (TypeError term uni fun ann) (ann, fun) Source # |
data FreeVariableError Source #
We cannot do a correct translation to or from de Bruijn indices if the program is not well-scoped. So we throw an error in such a case.
Instances
class AsFreeVariableError r where Source #
_FreeVariableError ∷ Prism' r FreeVariableError Source #
_FreeUnique ∷ Prism' r Unique Source #
_FreeIndex ∷ Prism' r Index Source #
Instances
AsFreeVariableError FreeVariableError Source # | |
Defined in PlutusCore.DeBruijn.Internal _FreeVariableError ∷ Prism' FreeVariableError FreeVariableError Source # _FreeUnique ∷ Prism' FreeVariableError Unique Source # _FreeIndex ∷ Prism' FreeVariableError Index Source # | |
AsFreeVariableError (Error uni fun ann) Source # | |
Defined in PlutusCore.Error _FreeVariableError ∷ Prism' (Error uni fun ann) FreeVariableError Source # _FreeUnique ∷ Prism' (Error uni fun ann) Unique Source # _FreeIndex ∷ Prism' (Error uni fun ann) Index Source # |
data Error uni fun ann Source #
ParseErrorE !ParserErrorBundle | |
UniqueCoherencyErrorE !(UniqueError ann) | |
TypeErrorE !(TypeError (Term TyName Name uni fun ()) uni fun ann) | |
NormCheckErrorE !(NormCheckError TyName Name uni fun ann) | |
FreeVariableErrorE !FreeVariableError |
Instances
class AsError r uni fun ann | r → uni fun ann where Source #
_Error ∷ Prism' r (Error uni fun ann) Source #
_ParseErrorE ∷ Prism' r ParserErrorBundle Source #
_UniqueCoherencyErrorE ∷ Prism' r (UniqueError ann) Source #
_TypeErrorE ∷ Prism' r (TypeError (Term TyName Name uni fun ()) uni fun ann) Source #
_NormCheckErrorE ∷ Prism' r (NormCheckError TyName Name uni fun ann) Source #
_FreeVariableErrorE ∷ Prism' r FreeVariableError Source #
Instances
AsError (Error uni fun ann) uni fun ann Source # | |
Defined in PlutusCore.Error _Error ∷ Prism' (Error uni fun ann) (Error uni fun ann) Source # _ParseErrorE ∷ Prism' (Error uni fun ann) ParserErrorBundle Source # _UniqueCoherencyErrorE ∷ Prism' (Error uni fun ann) (UniqueError ann) Source # _TypeErrorE ∷ Prism' (Error uni fun ann) (TypeError (Term TyName Name uni fun ()) uni fun ann) Source # _NormCheckErrorE ∷ Prism' (Error uni fun ann) (NormCheckError TyName Name uni fun ann) Source # _FreeVariableErrorE ∷ Prism' (Error uni fun ann) FreeVariableError Source # |
throwingEither ∷ MonadError e m ⇒ AReview e t → Either t a → m a Source #
class Ord a ⇒ ShowErrorComponent a where Source #
The type class defines how to print a custom component of ParseError
.
Since: megaparsec-5.0.0
showErrorComponent ∷ a → String Source #
Pretty-print a component of ParseError
.
errorComponentLen ∷ a → Int Source #
Length of the error component in characters, used for highlighting of parse errors in input string.
Since: megaparsec-7.0.0
Instances
ShowErrorComponent Void | |
Defined in Text.Megaparsec.Error | |
ShowErrorComponent ParserError Source # | |
Defined in PlutusCore.Error |
data ApplyProgramError Source #
Errors from applyProgram
for PIR, PLC, UPLC.