Skip to content

Why are async/generators privileged here? #9

@tabatkins

Description

@tabatkins

The big feature that makes this different from some of the other pipeline proposals is that if the function is a generator and/or async, it automagically alters how it calls the remaining chunks of the pipeline, and changes the type of the implicit function created by the pipeline to be generator and/or async as well.

This sort of functionality is useful in general, tho - there are plenty of "types" of values that I might want to have special calling behavior. For example, one function might return a Maybe value, representing a possibly-failed operation, and want to chain it to the next function in the pipeline only if the first operation succeeded...

This is a roundabout way of saying that this proposal is just giving us fmap (call, but for functors), but artificially restricted solely to the iterator and promise functors. It would be much more compelling if it figured out a way to give us arbitrary fmap and/or bind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions