-
Notifications
You must be signed in to change notification settings - Fork 102
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
Implements semigroup and monoid for Maybe. #125
Implements semigroup and monoid for Maybe. #125
Conversation
src/data/maybe/maybe.js
Outdated
@@ -42,6 +42,10 @@ const assertMaybe = assertType(Maybe); | |||
|
|||
|
|||
extend(Just.prototype, { | |||
empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this definition.
src/data/maybe/maybe.js
Outdated
@@ -52,6 +56,12 @@ extend(Just.prototype, { | |||
} | |||
}); | |||
|
|||
extend(Nothing.prototype, { | |||
empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one.
src/data/maybe/maybe.js
Outdated
* type: | | ||
* forall a: () => Maybe a | ||
*/ | ||
empty: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this :)
src/data/maybe/maybe.js
Outdated
* type: | | ||
* forall a: () => Maybe a | ||
*/ | ||
empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're all automatically derived from this one definition here :)
Looks neat, thanks! :) I've requested a few simple changes and then it's ready to be merged :) |
hmm, I've forgot to remove those when you fixed the test issue. :) |
377d18b
to
16ce056
Compare
Nice 👍 Could you add an
If you're up to writing docs too, a short description with usage examples (as explained here) would be neat! In this case, the category for |
871a1d8
to
9261aaa
Compare
9261aaa
to
7b51fcd
Compare
I tried to write all the docs, but Hope to take some time to hack with |
No worries :) Thanks |
Implements semigroup and monoid for Maybe.