fused-effects / fused-effects/fused-effects
Enable type-level distinctions between operations that thread state and those that don’t.
@robrix is already working on this.
Since Oct 25, 2019.
- Dominant language
- Haskell
- Stars
- 672
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
We removed the Resource effect in #268 because of its unlawful interactions with the State effect. This was the right move, but it is also a bummer, because the Resource effect is extremely useful.
What would be ideal is a system like polysemy’s Tactics module, which used in concert with Resource and the withLowerToIO system provided by their forklift implementation. Failing that, it would be ideal to have some type-level mechanism that rejects calls to functions like get and put inside a finally block:
finally :: (Has Resource sig, Carrier sig m, IsStatelessIn n m)
=> m a
-> n a
-> m a
where this hypothetical IsStatelessIn construct is fulfilled by Reader but not by State. Or something. Either approach would be acceptable to me; that would enable us to deprecate fused-effects-exceptions and welcome Resource back into the fold.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.