-
As the title says, I'm wondering if I can write a handler for the effect types defined in the library, like Looking at the source code, this effect does not seem to have any constructors: https://hackage.haskell.org/package/effectful-2.4.0.0/docs/src/Effectful.Console.Effect.html#Console And the operations of this effect seem to be directly calling the IO functions: https://hackage.haskell.org/package/effectful-2.4.0.0/docs/src/Effectful.Console.ByteString.html#getLine So I think the answer is no? If I get this right, then how do I handle effects of e.g. a library code that I don't have control over that uses one of these built-in effects like Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
This effect is defined as a statically dispatched effect which means it only has a single interpretation. So there is no way to redefine |
Beta Was this translation helpful? Give feedback.
-
Effects in the It also wasn't clear to me whether there exist other relevant interpretations of these effects. The good news is that statically dispatched effects are API wise forward compatible with being made dynamic, so there's nothing in principle preventing us from making them dynamic (or providing a dynamic variant) when it turns out alternative interpretations make sense. Would you mind expanding what it is exactly you planned to do that the current design prevents? |
Beta Was this translation helpful? Give feedback.
This effect is defined as a statically dispatched effect which means it only has a single interpretation. So there is no way to redefine
Console
.