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