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

Currying would make the Scala API easier to use (and more idiomatic, whatever that means) #50

Open
hseeberger opened this issue May 5, 2015 · 1 comment

Comments

@hseeberger
Copy link

As an example take the signature of Stream.accum:

final def accum[S](initState: S, f: (A, S) => S): Cell[S]

If this is changed to

final def accum[S](initState: S)(f: (A, S) => S): Cell[S]

users could omit the type argument, e.g.:

val ea = new StreamSink[Int]()
val out = new ArrayList[Int]()
val sum = ea.accum(100)((a, s) => a + s) // was `ea.accum[Int](100, (a, s) => a + s)`
@the-real-blackh
Copy link

First off, sorry about being unresponsive. I did not get notified that you raised this, for some reason.

I'd be happy to change that. I have quite a few changes that need to be made, and I'll get to those in an overhaul of the Sodium project as soon as I've finished the book, which is pretty soon now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants