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

PlutusCore.Error

Synopsis

data UniqueError ann #

Constructors

MultiplyDefined !Unique !ann !ann 
IncoherentUsage !Unique !ann !ann 
FreeVariable !Unique !ann 

Instances

Instances details
Functor UniqueError # 
Instance details

Defined in PlutusCore.Error

Methods

fmap :: (a -> b) -> UniqueError a -> UniqueError b #

(<$) :: a -> UniqueError b -> UniqueError a #

Exception (UniqueError SrcSpan) # 
Instance details

Defined in PlutusCore.Error

Generic (UniqueError ann) # 
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep (UniqueError ann) :: Type -> Type #

Methods

from :: UniqueError ann -> Rep (UniqueError ann) x #

to :: Rep (UniqueError ann) x -> UniqueError ann #

Show ann => Show (UniqueError ann) # 
Instance details

Defined in PlutusCore.Error

Methods

showsPrec :: Int -> UniqueError ann -> ShowS #

show :: UniqueError ann -> String #

showList :: [UniqueError ann] -> ShowS #

NFData ann => NFData (UniqueError ann) # 
Instance details

Defined in PlutusCore.Error

Methods

rnf :: UniqueError ann -> () #

Eq ann => Eq (UniqueError ann) # 
Instance details

Defined in PlutusCore.Error

Methods

(==) :: UniqueError ann -> UniqueError ann -> Bool #

(/=) :: UniqueError ann -> UniqueError ann -> Bool #

Pretty ann => Pretty (UniqueError ann) # 
Instance details

Defined in PlutusCore.Error

Methods

pretty :: UniqueError ann -> Doc ann0 #

prettyList :: [UniqueError ann] -> Doc ann0 #

type Rep (UniqueError ann) # 
Instance details

Defined in PlutusCore.Error

data ExpectedShapeOr a #

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.

Constructors

ExpectedShape 

Fields

data FreeVariableError #

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.

Constructors

FreeUnique !Unique 
FreeIndex !Index 

Instances

Instances details
Exception FreeVariableError # 
Instance details

Defined in PlutusCore.DeBruijn.Internal

errorComponentLen :: a -> Int #

Length of the error component in characters, used for highlighting of parse errors in input string.

Since: megaparsec-7.0.0

Orphan instances

Pretty SourcePos # 
Instance details

Methods

pretty :: SourcePos -> Doc ann #

prettyList :: [SourcePos] -> Doc ann #