Polysemy: Bundle
Polysemy comes with an useful effect to group other effects: Bundle
.
It comes with a useful function:
It can be used as follows:
act = do
sendBundle @Trace @'[Trace] $ trace "Hello"
The real benefit associated with Bundle
are the interpreters.
runBundle
injects Bundles
' effects:
intrHidden = runM . traceToStdout . runBundle
While subsumeBundle
reuse interpreters:
intrExplicit = runM . traceToStdout . subsumeBundle
See the full the code here.