| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cooked.MockChain.Misc
Description
This module defines primitives that offer quality of life features when operating a mockchain without interacting with the mockchain state itself.
Synopsis
- data MockChainMisc :: Effect where
- Define :: ToHash a => String -> a -> MockChainMisc m a
- Note :: (PrettyCookedOpts -> DocCooked) -> MockChainMisc m ()
- Assert :: String -> Bool -> MockChainMisc m ()
- runMockChainMisc :: forall effs a j. Member (Writer j) effs => (String -> BuiltinByteString -> j) -> ((PrettyCookedOpts -> DocCooked) -> j) -> (String -> Bool -> j) -> Sem (MockChainMisc : effs) a -> Sem effs a
- define :: forall effs a. (Member MockChainMisc effs, ToHash a) => String -> a -> Sem effs a
- defineM :: (Member MockChainMisc effs, ToHash a) => String -> Sem effs a -> Sem effs a
- note :: forall effs. Member MockChainMisc effs => (PrettyCookedOpts -> DocCooked) -> Sem effs ()
- noteP :: forall effs s. (Member MockChainMisc effs, PrettyCooked s) => s -> Sem effs ()
- noteL :: forall effs l. (Member MockChainMisc effs, PrettyCookedList l) => String -> l -> Sem effs ()
- noteW :: forall effs s. (Member MockChainMisc effs, Show s) => s -> Sem effs ()
- noteS :: forall effs. Member MockChainMisc effs => String -> Sem effs ()
- assert :: forall effs. Member MockChainMisc effs => String -> Bool -> Sem effs ()
- assert' :: forall effs. Member MockChainMisc effs => Bool -> Sem effs ()
Misc effect
data MockChainMisc :: Effect where Source #
An effect that corresponds to extra QOL capabilities of the MockChain
Constructors
| Define :: ToHash a => String -> a -> MockChainMisc m a | |
| Note :: (PrettyCookedOpts -> DocCooked) -> MockChainMisc m () | |
| Assert :: String -> Bool -> MockChainMisc m () |
Instances
| RunnableMockChain DirectEffs Source # | |
Defined in Cooked.MockChain.Instances Methods runMockChain :: MockChainState -> Sem DirectEffs a -> [RawMockChainReturn a] Source # | |
| RunnableMockChain FullEffs Source # | |
Defined in Cooked.MockChain.Instances Methods runMockChain :: MockChainState -> Sem FullEffs a -> [RawMockChainReturn a] Source # | |
| InterpretAlone extraEff => RunnableMockChain (ExtendedStagedEffs extraEff) Source # | |
Defined in Cooked.MockChain.Instances Methods runMockChain :: MockChainState -> Sem (ExtendedStagedEffs extraEff) a -> [RawMockChainReturn a] Source # | |
runMockChainMisc :: forall effs a j. Member (Writer j) effs => (String -> BuiltinByteString -> j) -> ((PrettyCookedOpts -> DocCooked) -> j) -> (String -> Bool -> j) -> Sem (MockChainMisc : effs) a -> Sem effs a Source #
Interpreting a MockChainMisc in terms of a writer of Map
BuiltinByteString String
Storing aliases for hashable elements
define :: forall effs a. (Member MockChainMisc effs, ToHash a) => String -> a -> Sem effs a Source #
Stores an alias matching a hashable data for pretty printing purpose
defineM :: (Member MockChainMisc effs, ToHash a) => String -> Sem effs a -> Sem effs a Source #
Like define, but binds the result of a monadic computation instead
Taking notes in the notebook
note :: forall effs. Member MockChainMisc effs => (PrettyCookedOpts -> DocCooked) -> Sem effs () Source #
Takes note of an element represented as its rendering function to trace at the end of the run
noteP :: forall effs s. (Member MockChainMisc effs, PrettyCooked s) => s -> Sem effs () Source #
Takes note of a pretty-printable element to trace at the end of the run
noteL :: forall effs l. (Member MockChainMisc effs, PrettyCookedList l) => String -> l -> Sem effs () Source #
Takes note of a pretty-printable element as list with a title, to trace at the end of the run
noteW :: forall effs s. (Member MockChainMisc effs, Show s) => s -> Sem effs () Source #
Takes note of a showable element to trace at the end of the run
noteS :: forall effs. Member MockChainMisc effs => String -> Sem effs () Source #
Takes note of a String to trace at the end of the run