Skip to content

Make Task a Monadic type #864

@FreeApophis

Description

@FreeApophis

We avoided to make Task a monad so far:

  • I regularly miss Sequence on Task<Option> Which would avoid await-hell in quite some places.
  • SelectMany with Task Types would allow a lot of simplification.
  • Select and SelectMany would swallow exceptions but I think I would be fine with it, because the Monadic interface cannot cause an exception, so the stacktrace only hides the location via indirection.

I suppose there are more downsides but I cannot really evaluate them without some hands-on experience.

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