Problem
We're recently ran into an issue (which I believe @paluh discussed with you) regarding the instances for StoreT.
Our issue was that we wanted to add StoreT to our AppM transformer stack, which already had a ReaderT with an environment type. However, because StoreT already has a MonadAsk instance for the store type, we had to manually implement some instances to get the behaviour we desired.
You can see details here, along with our workaround:
marlowe-lang/marlowe-cardano#39
Summary of the changes I've made and would like to PR:
Add new instances for StoreT:
MonadReader
MonadTell
MonadWriter
MonadState
MonadCont
MonadRec
MonadTrans
Distributive
Modify MonadAsk instance for StoreT to delegate to the base monad m instead of the wrapped ReaderT (HalogenStore a s)
MonadAsk - modified to delegate to base monad m with an instance of MonadAsk instead.
Add MonadStore instances for other monad transformers:
ContT
IdentityT
MaybeT
RWST
ReaderT
StateT
WriterT
I can PR the necessary changes to fix this issue, and have already implemented them in our fork https://github.com/input-output-hk/purescript-halogen-store
I'm not able to open a PR on this repo however, I assume that it's restricted to contributors only?
While this is a breaking change I'm proposing, the migration steps are very straigtforward. It should be a simple matter of substituting usages of ask with getStore.
Problem
We're recently ran into an issue (which I believe @paluh discussed with you) regarding the instances for
StoreT.Our issue was that we wanted to add
StoreTto ourAppMtransformer stack, which already had aReaderTwith an environment type. However, becauseStoreTalready has aMonadAskinstance for the store type, we had to manually implement some instances to get the behaviour we desired.You can see details here, along with our workaround:
marlowe-lang/marlowe-cardano#39
Summary of the changes I've made and would like to PR:
Add new instances for
StoreT:MonadReaderMonadTellMonadWriterMonadStateMonadContMonadRecMonadTransDistributiveModify
MonadAskinstance forStoreTto delegate to the base monadminstead of the wrappedReaderT (HalogenStore a s)MonadAsk- modified to delegate to base monadmwith an instance ofMonadAskinstead.Add
MonadStoreinstances for other monad transformers:ContTIdentityTMaybeTRWSTReaderTStateTWriterTI can PR the necessary changes to fix this issue, and have already implemented them in our fork https://github.com/input-output-hk/purescript-halogen-store
I'm not able to open a PR on this repo however, I assume that it's restricted to contributors only?
While this is a breaking change I'm proposing, the migration steps are very straigtforward. It should be a simple matter of substituting usages of
askwithgetStore.