This doesn't fully answer my question, but I wanted to put some relevant information in answer format:
"co" (loosely) means "flip the arrows". Here's a rough visual of that.
Consider the monadic operations:
return :: a ~> m a
flip (>>=) :: (a ~> m b) -> (m a ~> m b)
Reverse the squiggly arrows and you get the comonadic operations:
extract :: a <~ w a
extend :: (a <~ w b) -> (w a <~ w b)
(Written with normal arrows)
extract :: w a -> a
extend :: (w a -> b) -> w a -> w b
Notice how in this format, return
is an arrow that just so happens to fit in the argument slot for flip (>>=)
, and the same is true of extract
and extend
. Monad/comonad laws say that when you put return
or extract
into that slot, the result is the identity arrow. The laws are the same, "just with the arrows flipped". That's a super handwavey answer but hopefully it provides some insight.
return :: a ~> m a
,flip bind :: (a ~> m b) -> (m a ~> m b)
. Reverse the squiggly arrows and you get the comonadic operations:extract :: a <~ w a
,extend :: (a <~ w b) -> (w a <~ w b)
(extract :: w a -> a
,extend :: (w a -> b) -> w a -> w b
) – Dan Burton