fused-effects / fused-effects/fused-effects

Enable type-level distinctions between operations that thread state and those that don’t.

Open
#293 10 comments 1 reaction 1 assignee View on GitHub

@robrix is already working on this.

Since Oct 25, 2019.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.