|
|
|
|
|
by bspammer
1869 days ago
|
|
That’s a very pretty way to lay it out. I’ve never thought of reversing the order of arguments in the monad before, but it makes sense when you see it next to the others. What about this? Is this even possible? (T a -> b) -> T a -> T b I guess to complete the set you can also add this one which is not very interesting, it’s just “apply the function” (T a -> T b) -> T a -> T b |
|
> (T a -> b) -> T a -> T b
Yep; that's the signature for the "extend" method of a comonad.
https://hackage.haskell.org/package/comonad-5.0.8/docs/Contr...
Though I prefer the presentation with `duplicate :: w a -> w (w a)`, which is just the signature of Monad's `join` but flipped around.