Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flip around order of arguments #51

Open
masaeedu opened this issue Aug 5, 2018 · 1 comment
Open

Flip around order of arguments #51

masaeedu opened this issue Aug 5, 2018 · 1 comment
Assignees
Projects

Comments

@masaeedu
Copy link

masaeedu commented Aug 5, 2018

Thank you for a very useful library. It's a bit late to bring this up I think, but I thought I'd open an issue anyway; it seems like the current order of arguments is not great for partial application. From the README examples:

const compress = (numbers) => {
  return matches(numbers)(
    (x, y, xs) => x === y
      ? compress([x].concat(xs))
      : [x].concat(compress([y].concat(xs))),
    (x, xs) => x // stopping condition
  )
}

but if it accepted the case matchers first, it could just be:

const compress = matches(
  (x, y, xs) => x === y
    ? compress([x].concat(xs))
    : [x].concat(compress([y].concat(xs))),
  (x, xs) => x // stopping condition
)

It's not hard to define a flipped around version wherever I use it, but it'd be handy if the library just exported a different version of matches that took arguments in that order.

@leonardiwagner leonardiwagner added this to TODO in 1.1 via automation Sep 27, 2018
@leonardiwagner leonardiwagner self-assigned this Sep 27, 2018
1.1 automation moved this from TODO to Done Jul 17, 2019
@leonardiwagner leonardiwagner added this to To do in v2 via automation Oct 17, 2019
@leonardiwagner
Copy link
Member

going to release a v2 for such breaking change

1.1 automation moved this from Done to TODO Oct 17, 2019
v2 automation moved this from To do to In progress Oct 17, 2019
@leonardiwagner leonardiwagner moved this from In progress to To do in v2 Oct 17, 2019
@leonardiwagner leonardiwagner moved this from To do to Backlog in v2 Oct 17, 2019
@leonardiwagner leonardiwagner moved this from Backlog to To do in v2 Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.1
  
TODO
v2
  
To do
Development

No branches or pull requests

2 participants