Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of Trifunctor Hierarchy #2026

Closed
neko-kai opened this issue Oct 16, 2023 · 1 comment
Closed

Removal of Trifunctor Hierarchy #2026

neko-kai opened this issue Oct 16, 2023 · 1 comment
Assignees
Labels
Projects
Milestone

Comments

@neko-kai
Copy link
Member

neko-kai commented Oct 16, 2023

It's impossible to implement current trifunctor hierarchy typeclasses for ZIO 2: MonadAsk, Arrow etc.
ZIO 2 changed the environment API, removing the zio.Has data type, merging it into ZIO itself and requiring : Tag constraints on all operations with the environment. This makes it impossible to implement trifunctor hierarchy methods such as def ask[R]: F[R, Nothing, R] because we don't have a Tag for R. There are three reasonable paths forward:

  1. Don't change trifunctor hierarchy, instead implement it for an opaque newtype over ZIO that uses a custom FiberRef to store the environment. This would require converting to and from this newtype to use trifunctor methods.
  2. Change the trifunctor hierarchy to specialize it completely to ZIO ZEnvironment / or a copy of such interned in BIO. These abstractions would no longer truly represent pure Arrow/Reader semantics because of ZEnvironment's Set semantics.
  3. Just delete the trifunctor hierarchy completely. We haven't found much use for it and we see no evidence of it being used elsewhere. We asked about deleting it on Izumi telegram in June and there's been no dissent. Additionally, since version 1.1.0-M24 (Update to ZIO 2) the trifunctor hierarchy has been de facto unusable - with no instances for ZIO, there were zero implementors for trifunctor typeclasses. So far, no one has noticed and filed an issue, adding evidence to the argument that it won't be missed.

So far, we're going ahead with deleting it. This issue will stay open for some time in case anyone wants to discuss this.

@neko-kai neko-kai added the bio label Oct 16, 2023
@neko-kai neko-kai added this to the 1.1 milestone Oct 16, 2023
@neko-kai neko-kai added this to To do in DIStage via automation Oct 16, 2023
@neko-kai neko-kai self-assigned this Oct 16, 2023
neko-kai added a commit that referenced this issue Oct 16, 2023
@neko-kai
Copy link
Member Author

Trifunctor hierarchy was removed in #2027

DIStage automation moved this from To do to Done Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
DIStage
  
Done
Development

No branches or pull requests

2 participants