-
Notifications
You must be signed in to change notification settings - Fork 375
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
specify location of ‘empty’ method #162
Conversation
An instance method is more flexible than a static method. It facilitates > Identity([1, 2, 3]).empty() Identity([]) since Identity#empty can dispatch to the inner value's ‘empty’ method.
I find e.g. The typical implementation of Const.of = (_) => Const(OtherType.empty()) I'd probably go a step further and prefer the I'm not necessarily a fan of requiring it live on the |
That's not where I started, but it's where I ended up in the long discussion in #88. I'm afraid this is one of those square peg/round hole situations that are bound to come up when you try to merge static and dynamic typing. I don't know that there is a good solution. |
This was proposed in #82. This would mean that the Identity type could not satisfy Monoid, I believe. Does this bother you, @scott-christopher?
Hmm, I see the problem. It seems we have four options:
Does anyone object to the third option? It's an improvement on the status quo, and shouldn't make anyone sad. |
3 sounds reasonable On Tue, 13 Sep 2016, 13:05 David Chambers, notifications@github.com wrote:
|
I'll open a new pull request shortly. |
Commit message: