-
Notifications
You must be signed in to change notification settings - Fork 3
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
drop support for method-based API #5
Comments
I agree. Pending your decision on #6 I think dropping all instance methods is a great idea. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Function-based API:
Method-based API:
I would like to drop the method-based API for several reasons:
One way is better than two (for users primarily; implementation simplicity secondarily).
this
is an implicit argument. Explicit is better than implicit.The function-based API supports partial application and thus works well with Ramda-style functional pipelines; the method-based API does not.
Sanctuary favours functions (for the reasons listed above). It provides a
fromMaybe
function, for example, rather than agetOrElse
method.How do you feel about this proposal, @JAForbes? I realize I'm pulling the project further from your goal of maintaining backwards compatibility with union-type, but union-type embraces JavaScript's dynamic nature whereas Sanctuary projects do not. Optional arguments, ad hoc polymorphism, and
this
are used heavily in union-type, but are at odds with the Sanctuary philosophy.The text was updated successfully, but these errors were encountered: