promises are close to a monad so... what's a comonad
Conversation
a thing you can extract and duplicate, they're useful in modelling e.g. cellular automata
1
2
extract :: w a -> a
is the dual of
pure :: a -> m a
(w is the dual of m, ofc)
and
duplicate :: w a -> w (w a)
is the dual of
join :: m a -> m (m a)
the dual of (>>=) is called extend
1
4
ohh, so:
extend :: (w a -> b) -> w a -> w b
is the dual of
bind :: m a -> (a -> m b) -> m b
now wondering what programming with codo would look like… is that a thing?
2
2
it's not
2
1
1
1
2
well yes but you can't use it, you can only imagine it
3
1
if a language extension exists in print but nobody makes a pragma out of it, does it exist at all?
1
1
It’s as real as most of the language features I want I guess
1
2



