|
|
|
|
|
by haecceity
2372 days ago
|
|
So instead of requiring the callee to be async or not you have to make sure your caller is executing in the right effect handler context? Sounds like we replaced the coloring problem with another one? I can see how it benefits the language designer because you could implement try catch and async with this but how does it benefit the user? |
|
For user, it could be useful to separate what from the how. For example, we could have a function that launches effects to manipulate the file system, and for test/mock purpose we could catch this effects with handlers that mock the file system.
I know that the pattern dependency injection solve the same problem, but with effects you could do it with a more natural code.