| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cooked.MockChain.Instances
Description
This module exposes concrete instances to run a mockchain. There are 4 of them :
DirectMockChainexposes the minimal set of effects required to run a mockchain, without the ability to branch or modify runs. Use this only if you specifically want to disallowLtlmodifications.StagedMockChainexposes all the primitives required to run a mockchain, with the addition of branching andLtlmodifications using tweaks. This should be the environement to use in 99% of the cases.ExtendedStagedMockChainexposes the same primitives asStagedMockChain, with an additional custom effect that can both be used in the main thread and in the associated tweaks. This allows a mockchain run to depend on arbitrary additional effects (if multiple effects are needed, this single effect can be instantiated to aBundlewrapping up those effects).FullMockChainexposes all the effects used to process a mockchain run, including intermediate hidden in the other instances. This should only be used when explicitly executing internal primitives of cooked, such as balancing, is required.
Synopsis
- type DirectEffs = '[MockChainWrite, MockChainRead, MockChainMisc, Fail]
- type DirectMockChain a = Sem DirectEffs a
- type FullTweakEffs = '[MockChainMisc, MockChainRead, Fail, Error ToCardanoError, Error MockChainError, State MockChainState, MockChainLog, Writer MockChainJournal]
- type FullTweak a = TypedTweak FullTweakEffs a
- type FullEffs = '[ModifyGlobally (UntypedTweak FullTweakEffs), MockChainWrite, ModifyLocally (UntypedTweak FullTweakEffs), State [Ltl (UntypedTweak FullTweakEffs)], MockChainMisc, MockChainRead, Fail, Error ToCardanoError, Error MockChainError, State MockChainState, MockChainLog, Writer MockChainJournal, NonDet]
- type FullMockChain a = Sem FullEffs a
- type StagedTweakEffs = ExtendedStagedTweakEffs (Bundle '[])
- type StagedTweak a = TypedTweak StagedTweakEffs a
- type StagedEffs = ExtendedStagedEffs (Bundle '[])
- type StagedMockChain a = Sem StagedEffs a
- class InterpretAlone eff where
- runInterpretAlone :: Sem (eff : effs) a -> Sem effs a
- type ExtendedStagedTweakEffs extraEff = '[extraEff, MockChainMisc, MockChainRead, Fail]
- type ExtendedStagedTweak extraEff a = TypedTweak (ExtendedStagedTweakEffs extraEff) a
- type ExtendedStagedEffs extraEff = '[ModifyGlobally (UntypedTweak (ExtendedStagedTweakEffs extraEff)), MockChainWrite, extraEff, MockChainMisc, MockChainRead, Fail, NonDet]
- type ExtendedStagedMockChain extraEff a = Sem (ExtendedStagedEffs extraEff) a
Direct, simple mockchain instance
type DirectEffs = '[MockChainWrite, MockChainRead, MockChainMisc, Fail] Source #
The most direct stack of effects to run a mockchain
type DirectMockChain a = Sem DirectEffs a Source #
A mockchain computation built on top of the DirectEffs stack of effects
Staged mockchain instance with all effects
type FullTweakEffs = '[MockChainMisc, MockChainRead, Fail, Error ToCardanoError, Error MockChainError, State MockChainState, MockChainLog, Writer MockChainJournal] Source #
A stack of effects aimed at being used as modifications for a
FullMockChain computation
type FullTweak a = TypedTweak FullTweakEffs a Source #
A tweak computation based on the FullTweakEffs stack of effects
type FullEffs = '[ModifyGlobally (UntypedTweak FullTweakEffs), MockChainWrite, ModifyLocally (UntypedTweak FullTweakEffs), State [Ltl (UntypedTweak FullTweakEffs)], MockChainMisc, MockChainRead, Fail, Error ToCardanoError, Error MockChainError, State MockChainState, MockChainLog, Writer MockChainJournal, NonDet] Source #
A stack of effects which allows everything allowed by StagedEffs with the
addition of all the lower level effects required to interpret it.
type FullMockChain a = Sem FullEffs a Source #
A mockchain computation built on top of the FullEffs stack of effects
Staged mockchain instance with minimal effects
type StagedTweakEffs = ExtendedStagedTweakEffs (Bundle '[]) Source #
A stack of effects aimed at being used as modifications for a
StagedMockChain computation
type StagedTweak a = TypedTweak StagedTweakEffs a Source #
A tweak computation based on the StagedTweakEffs stack of effects
type StagedEffs = ExtendedStagedEffs (Bundle '[]) Source #
A stack of effects which allows everything allowed by DirectEffs with the
addition of branching and Ltl modification with tweaks living in
StagedTweakEffs
type StagedMockChain a = Sem StagedEffs a Source #
A mockchain computation built on top of the StagedEffs stack of effects
Staged mockchain instance with minimal effects and a custom effect
class InterpretAlone eff where Source #
The class of effects that can be interpreted on their own on top of an arbitrary stack of effects
Methods
runInterpretAlone :: Sem (eff : effs) a -> Sem effs a Source #
type ExtendedStagedTweakEffs extraEff = '[extraEff, MockChainMisc, MockChainRead, Fail] Source #
A stack of effects aimed at being used as modifications for a
StagedMockChain computation
type ExtendedStagedTweak extraEff a = TypedTweak (ExtendedStagedTweakEffs extraEff) a Source #
A tweak computation based on the ExtendedStagedTweakEffs stack of effects
type ExtendedStagedEffs extraEff = '[ModifyGlobally (UntypedTweak (ExtendedStagedTweakEffs extraEff)), MockChainWrite, extraEff, MockChainMisc, MockChainRead, Fail, NonDet] Source #
A stack of effects which allows everything allowed by DirectEffs with the
addition of branching and Ltl modification with tweaks living in
ExtendedStagedTweakEffs
type ExtendedStagedMockChain extraEff a = Sem (ExtendedStagedEffs extraEff) a Source #
A mockchain computation built on top of the ExtendedStagedEffs stack of
effects
Orphan instances
| RunnableMockChain DirectEffs Source # | |
Methods runMockChain :: MockChainState -> Sem DirectEffs a -> [RawMockChainReturn a] Source # | |
| RunnableMockChain FullEffs Source # | |
Methods runMockChain :: MockChainState -> Sem FullEffs a -> [RawMockChainReturn a] Source # | |
| InterpretAlone extraEff => RunnableMockChain (ExtendedStagedEffs extraEff) Source # | |
Methods runMockChain :: MockChainState -> Sem (ExtendedStagedEffs extraEff) a -> [RawMockChainReturn a] Source # | |