cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Tweak.Common

Description

This module defines Tweaks which are the building blocks of our DSL for attacks. They are skeleton modifications aware of the mockchain state.

Synopsis

Tweak effect

data Tweak :: Effect where Source #

An effect that allows to store or retrieve a TxSkel from a context

Constructors

GetTxSkel :: Tweak m TxSkel

Retrieves the TxSkel from the context

PutTxSkel :: TxSkel -> Tweak m ()

Overrides the TxSkel in the context

getTxSkel :: forall r. Member Tweak r => Sem r TxSkel Source #

Retrieves the TxSkel from the context

putTxSkel :: forall r. Member Tweak r => TxSkel -> Sem r () Source #

Overrides the TxSkel in the context

Running a tweak

runTweak :: TxSkel -> Sem (Tweak : effs) a -> Sem effs (TxSkel, a) Source #

Running a Tweak is equivalent to running a state monad storing a TxSkel

evalTweak :: TxSkel -> Sem (Tweak : effs) a -> Sem effs a Source #

Same as runTweak but discards the returned TxSkel

execTweak :: TxSkel -> Sem (Tweak : effs) a -> Sem effs TxSkel Source #

Same as runTweak but discards the returned value