You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.
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.
The text was updated successfully, but these errors were encountered:
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 asdef ask[R]: F[R, Nothing, R]
because we don't have a Tag for R. There are three reasonable paths forward:So far, we're going ahead with deleting it. This issue will stay open for some time in case anyone wants to discuss this.
The text was updated successfully, but these errors were encountered: