plutus-core-1.0.0.1: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

PlutusIR.Error

Documentation

data Error uni fun a Source #

Constructors

CompilationError a Text

A generic compilation error.

UnsupportedError a Text

An error relating specifically to an unsupported feature.

PLCError (Error uni fun a)

An error from running some PLC function, lifted into this error type for convenience.

PLCTypeError (TypeError (Term TyName Name uni fun ()) uni fun a) 
PIRTypeError (TypeErrorExt uni a) 

Instances

Instances details
(GShow uni, Closed uni, Everywhere uni PrettyConst, Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc (Error uni fun ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

prettyBy :: PrettyConfigPlc -> Error uni fun ann -> Doc ann0 #

prettyListBy :: PrettyConfigPlc -> [Error uni fun ann] -> Doc ann0 #

(PrettyUni uni ann, Pretty fun) => Show (Error uni fun ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

showsPrec :: Int -> Error uni fun ann -> ShowS Source #

show :: Error uni fun ann -> String Source #

showList :: [Error uni fun ann] -> ShowS Source #

(PrettyUni uni ann, Typeable uni, Typeable fun, Typeable ann, Pretty fun) => Exception (Error uni fun ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

toException :: Error uni fun ann -> SomeException Source #

fromException :: SomeException -> Maybe (Error uni fun ann) Source #

displayException :: Error uni fun ann -> String Source #

(Pretty ann, Pretty fun, GShow uni, Closed uni, Everywhere uni PrettyConst) => Pretty (Error uni fun ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

pretty :: Error uni fun ann -> Doc ann0 #

prettyList :: [Error uni fun ann] -> Doc ann0 #

HasErrorCode (Error _a _b _c) Source # 
Instance details

Defined in PlutusIR.Error

Methods

errorCode :: Error _a _b _c -> ErrorCode Source #

AsFreeVariableError (Error uni fun a) Source # 
Instance details

Defined in PlutusIR.Error

Methods

_FreeVariableError :: Prism' (Error uni fun a) FreeVariableError Source #

_FreeUnique :: Prism' (Error uni fun a) Unique Source #

_FreeIndex :: Prism' (Error uni fun a) Index Source #

AsTypeErrorExt (Error uni fun a) uni a Source # 
Instance details

Defined in PlutusIR.Error

Methods

_TypeErrorExt :: Prism' (Error uni fun a) (TypeErrorExt uni a) Source #

_MalformedDataConstrResType :: Prism' (Error uni fun a) (a, Type TyName uni a) Source #

AsError (Error uni fun a) uni fun a Source # 
Instance details

Defined in PlutusIR.Error

Methods

_Error :: Prism' (Error uni fun a) (Error uni fun a) Source #

_CompilationError :: Prism' (Error uni fun a) (a, Text) Source #

_UnsupportedError :: Prism' (Error uni fun a) (a, Text) Source #

_PLCError :: Prism' (Error uni fun a) (Error0 uni fun a) Source #

_PLCTypeError :: Prism' (Error uni fun a) (TypeError (Term TyName Name uni fun ()) uni fun a) Source #

_PIRTypeError :: Prism' (Error uni fun a) (TypeErrorExt uni a) Source #

AsTypeError (Error uni fun a) (Term TyName Name uni fun ()) uni fun a Source # 
Instance details

Defined in PlutusIR.Error

Methods

_TypeError :: Prism' (Error uni fun a) (TypeError (Term TyName Name uni fun ()) uni fun a) Source #

_KindMismatch :: Prism' (Error uni fun a) (a, Type TyName uni (), Kind (), Kind ()) Source #

_TypeMismatch :: Prism' (Error uni fun a) (a, Term TyName Name uni fun (), Type TyName uni (), Normalized (Type TyName uni ())) Source #

_FreeTypeVariableE :: Prism' (Error uni fun a) (a, TyName) Source #

_FreeVariableE :: Prism' (Error uni fun a) (a, Name) Source #

_UnknownBuiltinFunctionE :: Prism' (Error uni fun a) (a, fun) Source #

class AsTypeError r term uni fun ann | r -> term uni fun ann where Source #

Minimal complete definition

_TypeError

Methods

_TypeError :: Prism' r (TypeError term uni fun ann) Source #

_KindMismatch :: Prism' r (ann, Type TyName uni (), Kind (), Kind ()) Source #

_TypeMismatch :: Prism' r (ann, term, Type TyName uni (), Normalized (Type TyName uni ())) Source #

_FreeTypeVariableE :: Prism' r (ann, TyName) Source #

_FreeVariableE :: Prism' r (ann, Name) Source #

_UnknownBuiltinFunctionE :: Prism' r (ann, fun) Source #

Instances

Instances details
AsTypeError (Error uni fun ann) (Term TyName Name uni fun ()) uni fun ann Source # 
Instance details

Defined in PlutusCore.Error

Methods

_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 (), Kind (), Kind ()) Source #

_TypeMismatch :: Prism' (Error uni fun ann) (ann, Term TyName Name uni fun (), Type TyName uni (), Normalized (Type TyName uni ())) 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 (Error uni fun a) (Term TyName Name uni fun ()) uni fun a Source # 
Instance details

Defined in PlutusIR.Error

Methods

_TypeError :: Prism' (Error uni fun a) (TypeError (Term TyName Name uni fun ()) uni fun a) Source #

_KindMismatch :: Prism' (Error uni fun a) (a, Type TyName uni (), Kind (), Kind ()) Source #

_TypeMismatch :: Prism' (Error uni fun a) (a, Term TyName Name uni fun (), Type TyName uni (), Normalized (Type TyName uni ())) Source #

_FreeTypeVariableE :: Prism' (Error uni fun a) (a, TyName) Source #

_FreeVariableE :: Prism' (Error uni fun a) (a, Name) Source #

_UnknownBuiltinFunctionE :: Prism' (Error uni fun a) (a, fun) Source #

AsTypeError (TypeError term uni fun ann) term uni fun ann Source # 
Instance details

Defined in PlutusCore.Error

Methods

_TypeError :: Prism' (TypeError term uni fun ann) (TypeError term uni fun ann) Source #

_KindMismatch :: Prism' (TypeError term uni fun ann) (ann, Type TyName uni (), Kind (), Kind ()) Source #

_TypeMismatch :: Prism' (TypeError term uni fun ann) (ann, term, Type TyName uni (), Normalized (Type TyName uni ())) 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 TypeError term uni fun ann Source #

Instances

Instances details
(GShow uni, Closed uni, Everywhere uni PrettyConst, Pretty ann, Pretty fun, Pretty term) => PrettyBy PrettyConfigPlc (TypeError term uni fun ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

prettyBy :: PrettyConfigPlc -> TypeError term uni fun ann -> Doc ann0 #

prettyListBy :: PrettyConfigPlc -> [TypeError term uni fun ann] -> Doc ann0 #

Functor (TypeError term uni fun) Source # 
Instance details

Defined in PlutusCore.Error

Methods

fmap :: (a -> b) -> TypeError term uni fun a -> TypeError term uni fun b Source #

(<$) :: a -> TypeError term uni fun b -> TypeError term uni fun a Source #

(GEq uni, Eq ann, Eq term, Eq fun) => Eq (TypeError term uni fun ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

(==) :: TypeError term uni fun ann -> TypeError term uni fun ann -> Bool Source #

(/=) :: TypeError term uni fun ann -> TypeError term uni fun ann -> Bool Source #

(GShow uni, Show ann, Show term, Show fun) => Show (TypeError term uni fun ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

showsPrec :: Int -> TypeError term uni fun ann -> ShowS Source #

show :: TypeError term uni fun ann -> String Source #

showList :: [TypeError term uni fun ann] -> ShowS Source #

Generic (TypeError term uni fun ann) Source # 
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep (TypeError term uni fun ann) :: Type -> Type Source #

Methods

from :: TypeError term uni fun ann -> Rep (TypeError term uni fun ann) x Source #

to :: Rep (TypeError term uni fun ann) x -> TypeError term uni fun ann Source #

(Closed uni, NFData ann, NFData term, NFData fun) => NFData (TypeError term uni fun ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

rnf :: TypeError term uni fun ann -> () Source #

HasErrorCode (TypeError _a _b _c _d) Source # 
Instance details

Defined in PlutusCore.Error

Methods

errorCode :: TypeError _a _b _c _d -> ErrorCode Source #

AsTypeError (TypeError term uni fun ann) term uni fun ann Source # 
Instance details

Defined in PlutusCore.Error

Methods

_TypeError :: Prism' (TypeError term uni fun ann) (TypeError term uni fun ann) Source #

_KindMismatch :: Prism' (TypeError term uni fun ann) (ann, Type TyName uni (), Kind (), Kind ()) Source #

_TypeMismatch :: Prism' (TypeError term uni fun ann) (ann, term, Type TyName uni (), Normalized (Type TyName uni ())) 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 #

type Rep (TypeError term uni fun ann) Source # 
Instance details

Defined in PlutusCore.Error

type Rep (TypeError term uni fun ann) = D1 ('MetaData "TypeError" "PlutusCore.Error" "plutus-core-1.0.0.1-6wMiyL0yerXJu56t8zBoKx" 'False) ((C1 ('MetaCons "KindMismatch" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Type TyName uni ()))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Kind ())) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Kind ())))) :+: C1 ('MetaCons "TypeMismatch" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 term)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Type TyName uni ())) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Normalized (Type TyName uni ())))))) :+: (C1 ('MetaCons "FreeTypeVariableE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TyName)) :+: (C1 ('MetaCons "FreeVariableE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)) :+: C1 ('MetaCons "UnknownBuiltinFunctionE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 fun)))))

class AsTypeErrorExt r uni ann | r -> uni ann where Source #

Minimal complete definition

_TypeErrorExt

Methods

_TypeErrorExt :: Prism' r (TypeErrorExt uni ann) Source #

_MalformedDataConstrResType :: Prism' r (ann, Type TyName uni ann) Source #

Instances

Instances details
AsTypeErrorExt (TypeErrorExt uni ann) uni ann Source # 
Instance details

Defined in PlutusIR.Error

Methods

_TypeErrorExt :: Prism' (TypeErrorExt uni ann) (TypeErrorExt uni ann) Source #

_MalformedDataConstrResType :: Prism' (TypeErrorExt uni ann) (ann, Type TyName uni ann) Source #

AsTypeErrorExt (Error uni fun a) uni a Source # 
Instance details

Defined in PlutusIR.Error

Methods

_TypeErrorExt :: Prism' (Error uni fun a) (TypeErrorExt uni a) Source #

_MalformedDataConstrResType :: Prism' (Error uni fun a) (a, Type TyName uni a) Source #

class AsError r uni fun a | r -> uni fun a where Source #

Minimal complete definition

_Error

Methods

_Error :: Prism' r (Error uni fun a) Source #

_CompilationError :: Prism' r (a, Text) Source #

_UnsupportedError :: Prism' r (a, Text) Source #

_PLCError :: Prism' r (Error uni fun a) Source #

_PLCTypeError :: Prism' r (TypeError (Term TyName Name uni fun ()) uni fun a) Source #

_PIRTypeError :: Prism' r (TypeErrorExt uni a) Source #

Instances

Instances details
AsError (Error uni fun a) uni fun a Source # 
Instance details

Defined in PlutusIR.Error

Methods

_Error :: Prism' (Error uni fun a) (Error uni fun a) Source #

_CompilationError :: Prism' (Error uni fun a) (a, Text) Source #

_UnsupportedError :: Prism' (Error uni fun a) (a, Text) Source #

_PLCError :: Prism' (Error uni fun a) (Error0 uni fun a) Source #

_PLCTypeError :: Prism' (Error uni fun a) (TypeError (Term TyName Name uni fun ()) uni fun a) Source #

_PIRTypeError :: Prism' (Error uni fun a) (TypeErrorExt uni a) Source #

data TypeErrorExt uni ann Source #

Constructors

MalformedDataConstrResType ann (Type TyName uni ann) 

Instances

Instances details
PrettyUni uni ann => PrettyBy PrettyConfigPlc (TypeErrorExt uni ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

prettyBy :: PrettyConfigPlc -> TypeErrorExt uni ann -> Doc ann0 #

prettyListBy :: PrettyConfigPlc -> [TypeErrorExt uni ann] -> Doc ann0 #

(Eq ann, GEq uni) => Eq (TypeErrorExt uni ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

(==) :: TypeErrorExt uni ann -> TypeErrorExt uni ann -> Bool Source #

(/=) :: TypeErrorExt uni ann -> TypeErrorExt uni ann -> Bool Source #

(Show ann, GShow uni) => Show (TypeErrorExt uni ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

showsPrec :: Int -> TypeErrorExt uni ann -> ShowS Source #

show :: TypeErrorExt uni ann -> String Source #

showList :: [TypeErrorExt uni ann] -> ShowS Source #

Generic (TypeErrorExt uni ann) Source # 
Instance details

Defined in PlutusIR.Error

Associated Types

type Rep (TypeErrorExt uni ann) :: Type -> Type Source #

Methods

from :: TypeErrorExt uni ann -> Rep (TypeErrorExt uni ann) x Source #

to :: Rep (TypeErrorExt uni ann) x -> TypeErrorExt uni ann Source #

(NFData ann, Closed uni) => NFData (TypeErrorExt uni ann) Source # 
Instance details

Defined in PlutusIR.Error

Methods

rnf :: TypeErrorExt uni ann -> () Source #

HasErrorCode (TypeErrorExt _a _b) Source # 
Instance details

Defined in PlutusIR.Error

AsTypeErrorExt (TypeErrorExt uni ann) uni ann Source # 
Instance details

Defined in PlutusIR.Error

Methods

_TypeErrorExt :: Prism' (TypeErrorExt uni ann) (TypeErrorExt uni ann) Source #

_MalformedDataConstrResType :: Prism' (TypeErrorExt uni ann) (ann, Type TyName uni ann) Source #

type Rep (TypeErrorExt uni ann) Source # 
Instance details

Defined in PlutusIR.Error

type Rep (TypeErrorExt uni ann) = D1 ('MetaData "TypeErrorExt" "PlutusIR.Error" "plutus-core-1.0.0.1-6wMiyL0yerXJu56t8zBoKx" 'False) (C1 ('MetaCons "MalformedDataConstrResType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Type TyName uni ann))))

newtype Normalized a Source #

Constructors

Normalized 

Fields

Instances

Instances details
Functor Normalized Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

fmap :: (a -> b) -> Normalized a -> Normalized b Source #

(<$) :: a -> Normalized b -> Normalized a Source #

Applicative Normalized Source # 
Instance details

Defined in PlutusCore.Core.Type

Foldable Normalized Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

fold :: Monoid m => Normalized m -> m Source #

foldMap :: Monoid m => (a -> m) -> Normalized a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Normalized a -> m Source #

foldr :: (a -> b -> b) -> b -> Normalized a -> b Source #

foldr' :: (a -> b -> b) -> b -> Normalized a -> b Source #

foldl :: (b -> a -> b) -> b -> Normalized a -> b Source #

foldl' :: (b -> a -> b) -> b -> Normalized a -> b Source #

foldr1 :: (a -> a -> a) -> Normalized a -> a Source #

foldl1 :: (a -> a -> a) -> Normalized a -> a Source #

toList :: Normalized a -> [a] Source #

null :: Normalized a -> Bool Source #

length :: Normalized a -> Int Source #

elem :: Eq a => a -> Normalized a -> Bool Source #

maximum :: Ord a => Normalized a -> a Source #

minimum :: Ord a => Normalized a -> a Source #

sum :: Num a => Normalized a -> a Source #

product :: Num a => Normalized a -> a Source #

Traversable Normalized Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

traverse :: Applicative f => (a -> f b) -> Normalized a -> f (Normalized b) Source #

sequenceA :: Applicative f => Normalized (f a) -> f (Normalized a) Source #

mapM :: Monad m => (a -> m b) -> Normalized a -> m (Normalized b) Source #

sequence :: Monad m => Normalized (m a) -> m (Normalized a) Source #

PrettyBy config a => PrettyBy config (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

prettyBy :: config -> Normalized a -> Doc ann #

prettyListBy :: config -> [Normalized a] -> Doc ann #

Eq a => Eq (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

Show a => Show (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

Generic (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

Associated Types

type Rep (Normalized a) :: Type -> Type Source #

Methods

from :: Normalized a -> Rep (Normalized a) x Source #

to :: Rep (Normalized a) x -> Normalized a Source #

NFData a => NFData (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

rnf :: Normalized a -> () Source #

Pretty a => Pretty (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

Methods

pretty :: Normalized a -> Doc ann #

prettyList :: [Normalized a] -> Doc ann #

Flat a => Flat (Normalized a) 
Instance details

Defined in PlutusCore.Flat

Methods

encode :: Normalized a -> Encoding

decode :: Get (Normalized a)

size :: Normalized a -> NumBits -> NumBits

Rename a => Rename (Normalized a) Source # 
Instance details

Defined in PlutusCore.Rename

Methods

rename :: MonadQuote m => Normalized a -> m (Normalized a) Source #

type Rep (Normalized a) Source # 
Instance details

Defined in PlutusCore.Core.Type

type Rep (Normalized a) = D1 ('MetaData "Normalized" "PlutusCore.Core.Type" "plutus-core-1.0.0.1-6wMiyL0yerXJu56t8zBoKx" 'True) (C1 ('MetaCons "Normalized" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNormalized") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))