Skip to content

flatMap #18

@innermatrix

Description

@innermatrix

Please explain the feature or improvement you would like:

Please add async flatMap

Please describe the use case where you would need that feature (the general situation or type of program where that would be helpful):

Currently the best counterpart to

arr.flatMap((elt) => f(elt))

is

(await asyncMap(arr, async (elt) => await f(elt))).flatMap(elt => elt)

Which is janky. I would prefer

await asyncFlatMap(arr, async (elt) => await f(elt))

Please explain why you think that feature would be helpful to other people:

Because flatMap is in stdlib Array

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions