Replies: 2 comments 2 replies
-
You should represent the fact that the channel is not taking any input by using |
Beta Was this translation helpful? Give feedback.
-
A Another way to think about this is that You should represent your channel as a |
Beta Was this translation helpful? Give feedback.
-
I have a channel that doesn't accept any input (neither errors nor elements nor the final value):
ZChannel[Env, Nothing, Nothing, Nothing, OutErr, OutElem, OutDone]
. I want to turn it into aZStream
:I get an error "Cannot prove that Any <:< Nothing".
Why is it designed this way? A
ZStream
does not have any input by design, and my channel does not have any input due to its type, so turning the latter into the former should be a natural conversion.What's worse, I don't see any type-safe way to transform my channel into a channel that can be converted to a stream. I can use
contramapInZIO
andcontramapZIO
to get a channel withInElem
=Any
andInDone
=Any
, but IInErr
seems to be out of reach. So I may need to resort toasInstanceOf
which is dangerous.(Also see #7202.)
Beta Was this translation helpful? Give feedback.
All reactions