Skip to content

mapWithIndex and keepWithIndex are not consistent #36

@prestontw

Description

@prestontw

Hello! I'm starting out with reasonml. I'm confused why mapWithIndex and keepWithIndex have different parameter orders for their function parameter: mapWithIndex takes (int, 'a) => ... while keepWithIndex takes ('a, int) => ....

For comparison, Tablecloth's mapWithIndex has a consistent ordering with its filterWithIndex: f:(int -> 'a -> ...); Rust dodges this with an enumerate method for iterators which can then be filtered or mapped as necessary.

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