Skip to content

I can't just get the answer and builder out of Put in a single call. #151

Open

Description

@ekmett

There is no way to get out Put a -> (a, Builder) in a single call.

This is also a wart in the design of cereal.

This seems to be a bit of a lacuna in the current design.

Activity

  1. kolmodin commented on Oct 6, 2018

    @kolmodin
    Member

    So you want back the item you just wrote?

  2. ekmett commented on Oct 7, 2018

    @ekmett
    MemberAuthor

    PutM is a Monad. I have a legitimate usecase where I want to lift a PutM computation into a larger monad, which is juggling 3 such builders simultaneously, with some delicate interplay between the information being written to each, but to be able to do so I need to be able to "run" it without destroying all benefit of using it in the first place by round-tripping out to ByteString, so yes.

  3. konsumlamm commented on May 4, 2026

    @konsumlamm
    Contributor

    cereal calls this runPutMBuilder. Does anyone have a better idea for a name?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions