plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.StateMachine

Synopsis

Documentation

To write your contract as a state machine you need * Two types state and input for the state and inputs of the machine * A 'SM.StateMachineInstance state input' describing the transitions and checks of the state machine (this is the on-chain code) * A 'StateMachineClient state input' with the state machine instance and an allocation function

In many cases it is enough to define the transition function t :: (state, Value) -> input -> Maybe (TxConstraints state) and use mkStateMachine and mkStateMachineClient to get the client. You can then use runInitialise and runStep to initialise and transition the state machine. runStep gets the current state from the utxo set and makes the transition to the next state using the given input and taking care of all payments.

data StateMachineClient s i Source #

Client-side definition of a state machine.

Constructors

StateMachineClient 

Fields

data TxConstraints i o #

Instances

Instances details
Bifunctor TxConstraints 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Methods

bimap :: (a -> b) -> (c -> d) -> TxConstraints a c -> TxConstraints b d Source #

first :: (a -> b) -> TxConstraints a c -> TxConstraints b c Source #

second :: (b -> c) -> TxConstraints a b -> TxConstraints a c Source #

(Show i, Show o) => Show (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Generic (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Associated Types

type Rep (TxConstraints i o) :: Type -> Type Source #

Methods

from :: TxConstraints i o -> Rep (TxConstraints i o) x Source #

to :: Rep (TxConstraints i o) x -> TxConstraints i o Source #

Semigroup (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Monoid (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

(FromJSON i, FromJSON o) => FromJSON (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Methods

parseJSON :: Value -> Parser (TxConstraints i o)

parseJSONList :: Value -> Parser [TxConstraints i o]

(ToJSON i, ToJSON o) => ToJSON (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Methods

toJSON :: TxConstraints i o -> Value

toEncoding :: TxConstraints i o -> Encoding

toJSONList :: [TxConstraints i o] -> Value

toEncodingList :: [TxConstraints i o] -> Encoding

Monoid (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Methods

mempty :: TxConstraints i o

Semigroup (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

Methods

(<>) :: TxConstraints i o -> TxConstraints i o -> TxConstraints i o

type Rep (TxConstraints i o) 
Instance details

Defined in Ledger.Tx.Constraints.TxConstraints

type Rep (TxConstraints i o) = D1 ('MetaData "TxConstraints" "Ledger.Tx.Constraints.TxConstraints" "plutus-tx-constraints-1.2.0.0-9U3hMxZSaNH217R0XsdS0A" 'False) (C1 ('MetaCons "TxConstraints" 'PrefixI 'True) ((S1 ('MetaSel ('Just "txConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxConstraint]) :*: S1 ('MetaSel ('Just "txConstraintFuns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxConstraintFuns)) :*: (S1 ('MetaSel ('Just "txOwnInputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ScriptInputConstraint i]) :*: S1 ('MetaSel ('Just "txOwnOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ScriptOutputConstraint o]))))

data SMContractError Source #

Instances

Instances details
Eq SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Show SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Generic SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Associated Types

type Rep SMContractError :: Type -> Type Source #

FromJSON SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

parseJSON :: Value -> Parser SMContractError

parseJSONList :: Value -> Parser [SMContractError]

ToJSON SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

toJSON :: SMContractError -> Value

toEncoding :: SMContractError -> Encoding

toJSONList :: [SMContractError] -> Value

toEncodingList :: [SMContractError] -> Encoding

AsContractError SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

AsSMContractError SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

type Rep SMContractError Source # 
Instance details

Defined in Plutus.Contract.StateMachine

type Rep SMContractError = D1 ('MetaData "SMContractError" "Plutus.Contract.StateMachine" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "ChooserError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "UnableToExtractTransition" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SMCContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError))))

data StateMachine s i Source #

Specification of a state machine, consisting of a transition function that determines the next state from the current state and an input, and a checking function that checks the validity of the transition in the context of the current transaction.

Constructors

StateMachine 

Fields

  • smTransition :: State s -> i -> Maybe (TxConstraints Void Void, State s)

    The transition function of the state machine. Nothing indicates an invalid transition from the current state.

  • smFinal :: s -> Bool

    Check whether a state is the final state

  • smCheck :: s -> i -> ScriptContext -> Bool

    The condition checking function. Can be used to perform checks on the pending transaction that aren't covered by the constraints. smCheck is always run in addition to checking the constraints, so the default implementation always returns true.

  • smThreadToken :: Maybe ThreadToken

    The ThreadToken that identifies the contract instance. Make one with getThreadToken and pass it on to mkStateMachine. Initialising the machine will then mint a thread token value.

Instances

Instances details
ValidatorTypes (StateMachine s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Associated Types

type RedeemerType (StateMachine s i)

type DatumType (StateMachine s i)

type DatumType (StateMachine s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

type DatumType (StateMachine s i) = s
type RedeemerType (StateMachine s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

type RedeemerType (StateMachine s i) = i

data StateMachineInstance s i Source #

Constructors

StateMachineInstance 

Fields

data State s Source #

Constructors

State 

Fields

Instances

Instances details
Eq s => Eq (State s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Methods

(==) :: State s -> State s -> Bool Source #

(/=) :: State s -> State s -> Bool Source #

Show s => Show (State s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Generic (State s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Associated Types

type Rep (State s) :: Type -> Type Source #

Methods

from :: State s -> Rep (State s) x Source #

to :: Rep (State s) x -> State s Source #

FromJSON s => FromJSON (State s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Methods

parseJSON :: Value -> Parser (State s)

parseJSONList :: Value -> Parser [State s]

ToJSON s => ToJSON (State s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

Methods

toJSON :: State s -> Value

toEncoding :: State s -> Encoding

toJSONList :: [State s] -> Value

toEncodingList :: [State s] -> Encoding

type Rep (State s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine.OnChain

type Rep (State s) = D1 ('MetaData "State" "Plutus.Contract.StateMachine.OnChain" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (S1 ('MetaSel ('Just "stateData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 s) :*: S1 ('MetaSel ('Just "stateValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))

newtype OnChainState s i Source #

Typed representation of the on-chain state of a state machine instance

Constructors

OnChainState 

Fields

data WaitingResult t i s Source #

The outcome of waitForUpdateTimeout

Constructors

Timeout t

The timeout happened before any change of the on-chain state was detected

ContractEnded i

The state machine instance ended

Transition i s

The state machine instance transitioned to a new state

InitialState s

The state machine instance was initialised

Instances

Instances details
Functor (WaitingResult t i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

fmap :: (a -> b) -> WaitingResult t i a -> WaitingResult t i b Source #

(<$) :: a -> WaitingResult t i b -> WaitingResult t i a Source #

(Show t, Show i, Show s) => Show (WaitingResult t i s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Generic (WaitingResult t i s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Associated Types

type Rep (WaitingResult t i s) :: Type -> Type Source #

Methods

from :: WaitingResult t i s -> Rep (WaitingResult t i s) x Source #

to :: Rep (WaitingResult t i s) x -> WaitingResult t i s Source #

(FromJSON s, FromJSON t, FromJSON i) => FromJSON (WaitingResult t i s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

parseJSON :: Value -> Parser (WaitingResult t i s)

parseJSONList :: Value -> Parser [WaitingResult t i s]

(ToJSON s, ToJSON i, ToJSON t) => ToJSON (WaitingResult t i s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

toJSON :: WaitingResult t i s -> Value

toEncoding :: WaitingResult t i s -> Encoding

toJSONList :: [WaitingResult t i s] -> Value

toEncodingList :: [WaitingResult t i s] -> Encoding

type Rep (WaitingResult t i s) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

data InvalidTransition s i Source #

An invalid transition

Constructors

InvalidTransition 

Fields

Instances

Instances details
(Eq s, Eq i) => Eq (InvalidTransition s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

(Show s, Show i) => Show (InvalidTransition s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Generic (InvalidTransition s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Associated Types

type Rep (InvalidTransition s i) :: Type -> Type Source #

(FromJSON s, FromJSON i) => FromJSON (InvalidTransition s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

parseJSON :: Value -> Parser (InvalidTransition s i)

parseJSONList :: Value -> Parser [InvalidTransition s i]

(ToJSON i, ToJSON s) => ToJSON (InvalidTransition s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

Methods

toJSON :: InvalidTransition s i -> Value

toEncoding :: InvalidTransition s i -> Encoding

toJSONList :: [InvalidTransition s i] -> Value

toEncodingList :: [InvalidTransition s i] -> Encoding

type Rep (InvalidTransition s i) Source # 
Instance details

Defined in Plutus.Contract.StateMachine

type Rep (InvalidTransition s i) = D1 ('MetaData "InvalidTransition" "Plutus.Contract.StateMachine" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "InvalidTransition" 'PrefixI 'True) (S1 ('MetaSel ('Just "tfState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (State s))) :*: S1 ('MetaSel ('Just "tfInput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 i)))

data TransitionResult s i Source #

Result of an attempted transition

Constructors

TransitionFailure (InvalidTransition s i)

The transition is not allowed

TransitionSuccess s

The transition is allowed and results in a new state

data ThreadToken Source #

Constructors

ThreadToken TxOutRef CurrencySymbol 

Instances

Instances details
Eq ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Ord ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Show ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Generic ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Associated Types

type Rep ThreadToken :: Type -> Type Source #

FromJSON ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

parseJSON :: Value -> Parser ThreadToken

parseJSONList :: Value -> Parser [ThreadToken]

ToJSON ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

toJSON :: ThreadToken -> Value

toEncoding :: ThreadToken -> Encoding

toJSONList :: [ThreadToken] -> Value

toEncodingList :: [ThreadToken] -> Encoding

FromData ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

fromBuiltinData :: BuiltinData -> Maybe ThreadToken

ToData ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

toBuiltinData :: ThreadToken -> BuiltinData

UnsafeFromData ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

unsafeFromBuiltinData :: BuiltinData -> ThreadToken

Lift DefaultUni ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

lift :: ThreadToken -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

typeRep :: Proxy ThreadToken -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

type Rep ThreadToken = D1 ('MetaData "ThreadToken" "Plutus.Contract.StateMachine.ThreadToken" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "ThreadToken" 'PrefixI 'True) (S1 ('MetaSel ('Just "ttOutRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxOutRef) :*: S1 ('MetaSel ('Just "ttCurrencySymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CurrencySymbol)))

Constructing the machine instance

mkValidator :: forall s i. ToData s => StateMachine s i -> ValidatorType (StateMachine s i) Source #

Turn a state machine into a validator script.

mkStateMachine :: Maybe ThreadToken -> (State s -> i -> Maybe (TxConstraints Void Void, State s)) -> (s -> Bool) -> StateMachine s i Source #

A state machine that does not perform any additional checks on the ScriptContext (beyond enforcing the constraints)

Constructing the state machine client

mkStateMachineClient :: forall state input. StateMachineInstance state input -> StateMachineClient state input Source #

A state machine client with the defaultChooser function

defaultChooser :: forall state input. [OnChainState state input] -> Either SMContractError (OnChainState state input) Source #

A state chooser function that fails if confronted with anything other than exactly one output

getStates :: forall s i. (FromData s, ToData s) => StateMachineInstance s i -> Map TxOutRef DecoratedTxOut -> [OnChainState s i] Source #

Running the state machine

runGuardedStep Source #

Arguments

:: forall w a e state schema input. (AsSMContractError e, FromData state, ToData state, ToData input) 
=> StateMachineClient state input

The state machine

-> input

The input to apply to the state machine

-> (UnbalancedTx -> state -> state -> Maybe a)

The guard to check before running the step

-> Contract w schema e (Either a (TransitionResult state input)) 

Tries to run one step of a state machine: If the guard (the last argument) returns Nothing when given the unbalanced transaction to be submitted, the old state and the new step, the step is run and Right the new state is returned. If the guard returns Just a, Left a is returned instead.

runStep Source #

Arguments

:: forall w e state schema input. (AsSMContractError e, FromData state, ToData state, ToData input) 
=> StateMachineClient state input

The state machine

-> input

The input to apply to the state machine

-> Contract w schema e (TransitionResult state input) 

Run one step of a state machine, returning the new state.

runInitialise Source #

Arguments

:: forall w e state schema input. (FromData state, ToData state, ToData input, AsSMContractError e) 
=> StateMachineClient state input

The state machine

-> state

The initial state

-> Value

The value locked by the contract at the beginning

-> Contract w schema e state 

Initialise a state machine

runGuardedStepWith Source #

Arguments

:: forall w a e state schema input. (AsSMContractError e, FromData state, ToData state, ToData input) 
=> ScriptLookups (StateMachine state input)

Additional lookups

-> TxConstraints input state

Additional constraints

-> StateMachineClient state input

The state machine

-> input

The input to apply to the state machine

-> (UnbalancedTx -> state -> state -> Maybe a)

The guard to check before running the step

-> Contract w schema e (Either a (TransitionResult state input)) 

The same as runGuardedStep but we can supply additional constraints and lookups for transaction.

runStepWith Source #

Arguments

:: forall w e state schema input. (AsSMContractError e, FromData state, ToData state, ToData input) 
=> ScriptLookups (StateMachine state input)

Additional lookups

-> TxConstraints input state

Additional constraints

-> StateMachineClient state input

The state machine

-> input

The input to apply to the state machine

-> Contract w schema e (TransitionResult state input) 

Run one step of a state machine, returning the new state. We can supply additional constraints and lookups for transaction.

runInitialiseWith Source #

Arguments

:: forall w e state schema input. (FromData state, ToData state, ToData input, AsSMContractError e) 
=> ScriptLookups (StateMachine state input)

Additional lookups

-> TxConstraints input state

Additional constraints

-> StateMachineClient state input

The state machine

-> state

The initial state

-> Value

The value locked by the contract at the beginning

-> Contract w schema e state 

Initialise a state machine and supply additional constraints and lookups for transaction.

getThreadToken :: AsSMContractError e => Contract w schema e ThreadToken Source #

Create a thread token. The thread token contains a reference to an unspent output of the wallet, so it needs to used with mkStateMachine immediately, and the machine must be initialised, to prevent the output from getting spent in the mean time.

getOnChainState :: (AsSMContractError e, FromData state, ToData state) => StateMachineClient state i -> Contract w schema e (Maybe (OnChainState state i, Map TxOutRef DecoratedTxOut)) Source #

Get the current on-chain state of the state machine instance. Return Nothing if there is no state on chain. Throws an SMContractError if the number of outputs at the machine address is greater than one.

waitForUpdate :: forall state i w schema e. (AsSMContractError e, AsContractError e, FromData state, ToData state, FromData i) => StateMachineClient state i -> Contract w schema e (Maybe (OnChainState state i)) Source #

Wait until the on-chain state of the state machine instance has changed, and return the new state, or return Nothing if the instance has been terminated. If waitForUpdate is called before the instance has even started then it returns the first state of the instance as soon as it has started.

waitForUpdateUntilSlot :: (AsSMContractError e, AsContractError e, FromData state, ToData state, FromData i) => StateMachineClient state i -> Slot -> Contract w schema e (WaitingResult Slot i state) Source #

Wait for the on-chain state of the state machine instance to change until timeoutSlot, and return the new state, or return ContractEnded if the instance has been terminated. If waitForUpdate is called before the instance has even started then it returns the first state of the instance as soon as it has started.

waitForUpdateUntilTime :: (AsSMContractError e, AsContractError e, FromData state, ToData state, FromData i) => StateMachineClient state i -> POSIXTime -> Contract w schema e (WaitingResult POSIXTime i state) Source #

Same as waitForUpdateUntilSlot, but works with POSIXTime instead.

waitForUpdateTimeout Source #

Arguments

:: forall state i t w schema e. (AsSMContractError e, AsContractError e, FromData state, ToData state, FromData i) 
=> StateMachineClient state i

The state machine client

-> Promise w schema e t

The timeout

-> Contract w schema e (Promise w schema e (WaitingResult t i (OnChainState state i))) 

Construct a Promise that waits for an update to the state machine's on-chain state, or a user-defined timeout (whichever happens first).

Lower-level API

data StateMachineTransition state input Source #

Constraints & lookups needed to transition a state machine instance

Constructors

StateMachineTransition 

Fields

mkStep :: forall w e state schema input. (AsSMContractError e, FromData state, ToData state) => StateMachineClient state input -> input -> Contract w schema e (Either (InvalidTransition state input) (StateMachineTransition state input)) Source #

Given a state machine client and an input to apply to the client's state machine instance, compute the StateMachineTransition that can produce an actual transaction performing the transition

Re-exports

data Void Source #

Uninhabited data type

Since: base-4.8.0.0

Instances

Instances details
Eq Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Methods

(==) :: Void -> Void -> Bool Source #

(/=) :: Void -> Void -> Bool Source #

Data Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Methods

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

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

toConstr :: Void -> Constr Source #

dataTypeOf :: Void -> DataType Source #

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

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

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

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

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

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

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

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

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

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void Source #

Ord Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Read Void

Reading a Void value is always a parse error, considering Void as a data type with no constructors.

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Show Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Ix Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Generic Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Associated Types

type Rep Void :: Type -> Type Source #

Methods

from :: Void -> Rep Void x Source #

to :: Rep Void x -> Void Source #

Semigroup Void

Since: base-4.9.0.0

Instance details

Defined in Data.Void

Exception Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

FromJSON Void 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

parseJSON :: Value -> Parser Void

parseJSONList :: Value -> Parser [Void]

ToJSON Void 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSON :: Void -> Value

toEncoding :: Void -> Encoding

toJSONList :: [Void] -> Value

toEncodingList :: [Void] -> Encoding

Hashable Void 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Void -> Int

hash :: Void -> Int

Pretty Void 
Instance details

Defined in Prettyprinter.Internal

Methods

pretty :: Void -> Doc ann

prettyList :: [Void] -> Doc ann

Serialise Void 
Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Void -> Encoding

decode :: Decoder s Void

encodeList :: [Void] -> Encoding

decodeList :: Decoder s [Void]

FromData Void 
Instance details

Defined in PlutusTx.IsData.Class

Methods

fromBuiltinData :: BuiltinData -> Maybe Void

ToData Void 
Instance details

Defined in PlutusTx.IsData.Class

Methods

toBuiltinData :: Void -> BuiltinData

UnsafeFromData Void 
Instance details

Defined in PlutusTx.IsData.Class

Methods

unsafeFromBuiltinData :: BuiltinData -> Void

FromHttpApiData Void 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Void

parseHeader :: ByteString -> Either Text Void

parseQueryParam :: Text -> Either Text Void

ToHttpApiData Void 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Void -> Text

toEncodedUrlPiece :: Void -> Builder

toHeader :: Void -> ByteString

toQueryParam :: Void -> Text

NoThunks Void 
Instance details

Defined in NoThunks.Class

Methods

noThunks :: Context -> Void -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> Void -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy Void -> String

ShowErrorComponent Void 
Instance details

Defined in Text.Megaparsec.Error

ValidatorTypes Void 
Instance details

Defined in Plutus.Script.Utils.Typed

Associated Types

type RedeemerType Void

type DatumType Void

FromFormKey Void 
Instance details

Defined in Web.Internal.FormUrlEncoded

Methods

parseFormKey :: Text -> Either Text Void

ToFormKey Void 
Instance details

Defined in Web.Internal.FormUrlEncoded

Methods

toFormKey :: Void -> Text

Lift Void

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Void -> Q Exp Source #

liftTyped :: Void -> Q (TExp Void) Source #

PrettyDefaultBy config Void => PrettyBy config Void 
Instance details

Defined in Text.PrettyBy.Internal

Methods

prettyBy :: config -> Void -> Doc ann

prettyListBy :: config -> [Void] -> Doc ann

DefaultPrettyBy config Void 
Instance details

Defined in Text.PrettyBy.Internal

Methods

defaultPrettyBy :: config -> Void -> Doc ann

defaultPrettyListBy :: config -> [Void] -> Doc ann

FoldableWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> V1 a -> m

ifoldMap' :: Monoid m => (Void -> a -> m) -> V1 a -> m

ifoldr :: (Void -> a -> b -> b) -> b -> V1 a -> b

ifoldl :: (Void -> b -> a -> b) -> b -> V1 a -> b

ifoldr' :: (Void -> a -> b -> b) -> b -> V1 a -> b

ifoldl' :: (Void -> b -> a -> b) -> b -> V1 a -> b

FoldableWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> U1 a -> m

ifoldMap' :: Monoid m => (Void -> a -> m) -> U1 a -> m

ifoldr :: (Void -> a -> b -> b) -> b -> U1 a -> b

ifoldl :: (Void -> b -> a -> b) -> b -> U1 a -> b

ifoldr' :: (Void -> a -> b -> b) -> b -> U1 a -> b

ifoldl' :: (Void -> b -> a -> b) -> b -> U1 a -> b

FoldableWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Proxy a -> m

ifoldMap' :: Monoid m => (Void -> a -> m) -> Proxy a -> m

ifoldr :: (Void -> a -> b -> b) -> b -> Proxy a -> b

ifoldl :: (Void -> b -> a -> b) -> b -> Proxy a -> b

ifoldr' :: (Void -> a -> b -> b) -> b -> Proxy a -> b

ifoldl' :: (Void -> b -> a -> b) -> b -> Proxy a -> b

FunctorWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> V1 a -> V1 b

FunctorWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> U1 a -> U1 b

FunctorWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> Proxy a -> Proxy b

TraversableWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> V1 a -> f (V1 b)

TraversableWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> U1 a -> f (U1 b)

TraversableWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Proxy a -> f (Proxy b)

FoldableWithIndex Void (Const e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Const e a -> m

ifoldMap' :: Monoid m => (Void -> a -> m) -> Const e a -> m

ifoldr :: (Void -> a -> b -> b) -> b -> Const e a -> b

ifoldl :: (Void -> b -> a -> b) -> b -> Const e a -> b

ifoldr' :: (Void -> a -> b -> b) -> b -> Const e a -> b

ifoldl' :: (Void -> b -> a -> b) -> b -> Const e a -> b

FoldableWithIndex Void (Constant e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Constant e a -> m

ifoldMap' :: Monoid m => (Void -> a -> m) -> Constant e a -> m

ifoldr :: (Void -> a -> b -> b) -> b -> Constant e a -> b

ifoldl :: (Void -> b -> a -> b) -> b -> Constant e a -> b

ifoldr' :: (Void -> a -> b -> b) -> b -> Constant e a -> b

ifoldl' :: (Void -> b -> a -> b) -> b -> Constant e a -> b

FunctorWithIndex Void (Const e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> Const e a -> Const e b

FunctorWithIndex Void (Constant e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> Constant e a -> Constant e b

TraversableWithIndex Void (Const e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Const e a -> f (Const e b)

TraversableWithIndex Void (Constant e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Constant e a -> f (Constant e b)

FoldableWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> K1 i c a -> m

ifoldMap' :: Monoid m => (Void -> a -> m) -> K1 i c a -> m

ifoldr :: (Void -> a -> b -> b) -> b -> K1 i c a -> b

ifoldl :: (Void -> b -> a -> b) -> b -> K1 i c a -> b

ifoldr' :: (Void -> a -> b -> b) -> b -> K1 i c a -> b

ifoldl' :: (Void -> b -> a -> b) -> b -> K1 i c a -> b

FunctorWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> K1 i c a -> K1 i c b

TraversableWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> K1 i c a -> f (K1 i c b)

type Rep Void 
Instance details

Defined in Data.Void

type Rep Void = D1 ('MetaData "Void" "Data.Void" "base" 'False) (V1 :: Type -> Type)
type DatumType Void 
Instance details

Defined in Plutus.Script.Utils.Typed

type DatumType Void = Void
type RedeemerType Void 
Instance details

Defined in Plutus.Script.Utils.Typed

type RedeemerType Void = Void
type Code Void 
Instance details

Defined in Generics.SOP.Instances

type Code Void = '[] :: [[Type]]
type DatatypeInfoOf Void 
Instance details

Defined in Generics.SOP.Instances

type DatatypeInfoOf Void = 'ADT "Data.Void" "Void" ('[] :: [ConstructorInfo]) ('[] :: [[StrictnessInfo]])