plutus-contract-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.Trace.RequestHandler

Synopsis

Documentation

newtype RequestHandler effs req resp Source #

Request handlers that can choose whether to handle an effect (using Alternative). This is useful if req is a sum type.

Constructors

RequestHandler 

Fields

Instances

Instances details
Arrow (RequestHandler effs) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

arr :: (b -> c) -> RequestHandler effs b c Source #

first :: RequestHandler effs b c -> RequestHandler effs (b, d) (c, d) Source #

second :: RequestHandler effs b c -> RequestHandler effs (d, b) (d, c) Source #

(***) :: RequestHandler effs b c -> RequestHandler effs b' c' -> RequestHandler effs (b, b') (c, c') Source #

(&&&) :: RequestHandler effs b c -> RequestHandler effs b c' -> RequestHandler effs b (c, c') Source #

Profunctor (RequestHandler effs) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

dimap :: (a -> b) -> (c -> d) -> RequestHandler effs b c -> RequestHandler effs a d Source #

lmap :: (a -> b) -> RequestHandler effs b c -> RequestHandler effs a c Source #

rmap :: (b -> c) -> RequestHandler effs a b -> RequestHandler effs a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> RequestHandler effs a b -> RequestHandler effs a c Source #

(.#) :: forall a b c q. Coercible b a => RequestHandler effs b c -> q a b -> RequestHandler effs a c Source #

Category (RequestHandler effs :: Type -> Type -> Type) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

id :: forall (a :: k). RequestHandler effs a a Source #

(.) :: forall (b :: k) (c :: k) (a :: k). RequestHandler effs b c -> RequestHandler effs a b -> RequestHandler effs a c Source #

Functor (RequestHandler effs req) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

fmap :: (a -> b) -> RequestHandler effs req a -> RequestHandler effs req b Source #

(<$) :: a -> RequestHandler effs req b -> RequestHandler effs req a Source #

Semigroup (RequestHandler effs req resp) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

(<>) :: RequestHandler effs req resp -> RequestHandler effs req resp -> RequestHandler effs req resp Source #

sconcat :: NonEmpty (RequestHandler effs req resp) -> RequestHandler effs req resp Source #

stimes :: Integral b => b -> RequestHandler effs req resp -> RequestHandler effs req resp Source #

Monoid (RequestHandler effs req resp) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

mempty :: RequestHandler effs req resp Source #

mappend :: RequestHandler effs req resp -> RequestHandler effs req resp -> RequestHandler effs req resp Source #

mconcat :: [RequestHandler effs req resp] -> RequestHandler effs req resp Source #

data RequestHandlerLogMsg Source #

Instances

Instances details
Eq RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Show RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Generic RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Associated Types

type Rep RequestHandlerLogMsg :: Type -> Type Source #

ToJSON RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

FromJSON RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Pretty RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

type Rep RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

type Rep RequestHandlerLogMsg = D1 ('MetaData "RequestHandlerLogMsg" "Wallet.Emulator.LogMessages" "plutus-contract-0.1.0.0-2DbvKQdtEvHK4UkDq1ndDW" 'False) ((C1 ('MetaCons "SlotNoticationTargetVsCurrent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Slot) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Slot)) :+: C1 ('MetaCons "StartWatchingContractAddresses" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HandleTxFailed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 WalletAPIError)) :+: C1 ('MetaCons "UtxoAtFailed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address))))

tryHandler :: forall effs req resp. RequestHandler effs req resp -> [req] -> Eff effs (Maybe resp) Source #

tryHandler' :: forall f effs req resp. (Alternative f, Monad f) => RequestHandler effs req (f resp) -> [req] -> Eff effs (f resp) Source #

wrapHandler :: RequestHandler effs req resp -> RequestHandler effs (Request req) (Response resp) Source #

extract :: Alternative f => Prism' a b -> a -> f b Source #

maybeToHandler :: (req -> Maybe resp) -> RequestHandler effs req resp Source #

generalise :: forall effs req req' resp resp'. (req' -> Maybe req) -> (resp -> resp') -> RequestHandler effs req resp -> RequestHandler effs req' resp' Source #

Generalise a request handler

handlers for common requests