hey here's a basic question: is `Channel` a monad?
# coroutines
g
hey here's a basic question: is
Channel
a monad?
s
It has
map
and `flatMap`… in that way, yes, it’s a monad 🙂
Job
is not a monad
g
Right but, does that mean we get some tests from monadic laws? Is
EmptyChannel
really a fair empty case? How does suspension play into it? If
Channel
is monadic, then
BlockingQueue
is too? I'm just... hmm.
a
@groostav you might want to look into #arrow if you're interested in that kind of stuff
s
@groostav Yeah… not sure about how
applicative
a Channel is.. (does it have a
just
function?) But it has map and flatMap and that is something 🙂 But in the true sense of the word, a Channel may not be monadic.
I wouldn’t be surprised if the folks at Arrow will make a Channel fully monadic, as they did with Rx (eg with their
ObservableK
, etc from their Arrow library). Maybe they are already thinking about a
ChannelK
type 🙂
a
that would make sense, yes