In the past few weeks, I have contributed to a library in which monads of ports (mainly from mtl) to shooters.
Here is an example with a monad StateTfrom mtl:
newtype StateT s m a = StateT { runStateT :: s -> m (a, s) }
-- arrowization -->
newtype StateTA s a b c = StateTA { runStateTA :: a (b, s) (c, s) }
The "shooting" process was not very painful for most monads, but I can not understand my arrow based on Store comonad.
Every time I asked this question, people redirected me to an arrow Cokleisli, but will there be an Cokleisli Storeequivalent arrow that I am looking for?
The library is based on the mtl-style architecture (each arrow has a common class, for example ArrowState, ArrowReaderetc.), I tried to figure out what the signatures of my function will be ArrowStore, but again, I can not.
I looked at a package arrowsthat implements the same arrows as in the library I'm working on, but their arrow CoState(I heard that CoState was a different name for the store) does not define any operations, so I guess the author also has problems with this problem.
TL; DR:
- Is the
Monad m => Kleisli m a barrow version equivalent m? - Is this also true for arrow comonads
Cokleisli? - If so, how can I express
Storecomonad as an arrow? - If not, can we even “shoot” comonads?
source
share