cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.Instances

Description

This module exposes concrete instances to run a mockchain. There are 4 of them :

  • DirectMockChain exposes 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 disallow Ltl modifications.
  • StagedMockChain exposes all the primitives required to run a mockchain, with the addition of branching and Ltl modifications using tweaks. This should be the environement to use in 99% of the cases.
  • ExtendedStagedMockChain exposes the same primitives as StagedMockChain, 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 a Bundle wrapping up those effects).
  • FullMockChain exposes 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

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 #

Instances

Instances details
InterpretAlone (Bundle ('[] :: [(Type -> Type) -> Type -> Type])) Source # 
Instance details

Defined in Cooked.MockChain.Instances

Methods

runInterpretAlone :: forall (effs :: [Effect]) a. Sem (Bundle '[] ': 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