Skip to content

No instances for recently-added monads from transformers #44

Closed

Description

@bucklereed

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.

Activity

  1. changed the title [-]No instances for recently-added monads[/-] [+]No instances for recently-added monads from transformers[/+] on Jul 24, 2017
  2. RyanGlScott commented on Jul 25, 2017

    @RyanGlScott
    Member

    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.

  3. fizruk commented on Jul 25, 2017

    @fizruk

    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.

  4. RyanGlScott commented on Jul 25, 2017

    @RyanGlScott
    Member

    @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.

  5. ekmett commented on Sep 28, 2017

    @ekmett
    Member

    I'm also leaning towards adding MonadAccum and the like.

  6. treeowl commented on Dec 5, 2017

    @treeowl

    I just got bitten by the lack of a MonadError instance for AccumT.

  7. minad commented on Nov 23, 2018

    @minad

    See also #38

  8. chessai commented on Jul 16, 2021

    @chessai
    Member

    This is resolved in master, pending 2.3 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions