Skip to content

use Tuple for partition results #102

@matthewleon

Description

@matthewleon

The result structure for partition is a bit idiosyncratic:

partition :: forall a. (a -> Boolean) -> Array a -> { yes :: Array a, no :: Array a }

I get the impression that, over time, purescript APIs have been preferring Tuples for this kind of thing, rather than ad-hoc records. What do people think of either (breaking) switching the API to returning a Tuple, or making a partition' that returns Tuples?

For comparison, partition from the Haskell prelude:

partition :: (a -> Bool) -> [a] -> ([a], [a])

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