You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No instances for recently-added monads from transformers #44
Control.Monad.Trans.Accum was added in transformers 0.5.3.0, but currently it's slightly painful to use because it doesn't have the usual MonadState, MonadReader, etc instances yet.
Whether it should get a MonadWriter instance that lifts the operations to the inner monad or handles them itself is a question.
SelectT was also added in transformers 0.5.3.0 and similarly lacks instances.
We should definitely add instances for AccumT and SelectT.
As far as how AccumT's instances should work, I'm not sure. @fizruk had proposed in #32 that we introduce a new type class for things that can support AccumT's operations (MonadAccum?), but it's not clear to me what its relationship with MonadWriter/MonadState would be.
I think there are enough design questions here that it would be beneficial to draft up a sketch of how this would work and propose it to the Haskell libraries mailing list for feedback.
I think that AccumT should propagate MonadReader, MonadWriter and MonadState to inner monad and that we should introduce MonadAccum. This would be consistent with how other classes and transformers work.
@fizruk, that sounds reasonable to me. But the design of these Monad- classes are usually more involved than one would initially believe (at least in my experience), so I think it would help to come up with a concrete design and propose it to the mailing list. If the community likes it, I'll accept a PR which implements it.
Activity
[-]No instances for recently-added monads[/-][+]No instances for recently-added monads from transformers[/+]RyanGlScott commentedon Jul 25, 2017
We should definitely add instances for
AccumTandSelectT.As far as how
AccumT's instances should work, I'm not sure. @fizruk had proposed in #32 that we introduce a new type class for things that can supportAccumT's operations (MonadAccum?), but it's not clear to me what its relationship withMonadWriter/MonadStatewould be.I think there are enough design questions here that it would be beneficial to draft up a sketch of how this would work and propose it to the Haskell libraries mailing list for feedback.
fizruk commentedon Jul 25, 2017
I think that
AccumTshould propagateMonadReader,MonadWriterandMonadStateto inner monad and that we should introduceMonadAccum. This would be consistent with how other classes and transformers work.RyanGlScott commentedon Jul 25, 2017
@fizruk, that sounds reasonable to me. But the design of these
Monad-classes are usually more involved than one would initially believe (at least in my experience), so I think it would help to come up with a concrete design and propose it to the mailing list. If the community likes it, I'll accept a PR which implements it.ekmett commentedon Sep 28, 2017
I'm also leaning towards adding MonadAccum and the like.
treeowl commentedon Dec 5, 2017
I just got bitten by the lack of a
MonadErrorinstance forAccumT.minad commentedon Nov 23, 2018
See also #38
chessai commentedon Jul 16, 2021
This is resolved in master, pending 2.3 release