Skip to content
This repository was archived by the owner on Jul 12, 2025. It is now read-only.

Implements semigroup and monoid for Maybe. - #125

Merged
robotlolita merged 1 commit into
origamitower:masterfrom
diasbruno:feature/maybe-semigroup-monoid
May 30, 2017
Merged

robotlolita merged 1 commit into
origamitower:masterfrom
diasbruno:feature/maybe-semigroup-monoid

Conversation

@diasbruno

Copy link
Copy Markdown
Contributor

Implements semigroup and monoid for Maybe.

Comment thread src/data/maybe/maybe.js Outdated


extend(Just.prototype, {
empty() {

Copy link
Copy Markdown
Member

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.

Comment thread src/data/maybe/maybe.js Outdated
});

extend(Nothing.prototype, {
empty() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one.

Comment thread src/data/maybe/maybe.js Outdated
/*~
* type: |
* forall a: () => Maybe a
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this :)

Comment thread src/data/maybe/maybe.js
/*~
* type: |
* forall a: () => Maybe a
*/

Copy link
Copy Markdown
Member

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 :)

@robotlolita

Copy link
Copy Markdown
Member

Looks neat, thanks! :)

I've requested a few simple changes and then it's ready to be merged :)

@diasbruno

Copy link
Copy Markdown
Contributor Author

hmm, I've forgot to remove those when you fixed the test issue. :)
Is anything else missing? (docs...)

@diasbruno
diasbruno force-pushed the feature/maybe-semigroup-monoid branch from 377d18b to 16ce056 Compare May 27, 2017 01:18
@robotlolita

Copy link
Copy Markdown
Member

Nice πŸ‘

Could you add an authors metadata to the methods you've added? Like:

/*~
 * authors:
 *   - "@diasbruno"
 * type: |
 *   ...
 */

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 empty would be Constructing, and the category for concat would be Combining.

@diasbruno
diasbruno force-pushed the feature/maybe-semigroup-monoid branch 3 times, most recently from 871a1d8 to 9261aaa Compare May 27, 2017 09:13
@diasbruno
diasbruno force-pushed the feature/maybe-semigroup-monoid branch from 9261aaa to 7b51fcd Compare May 27, 2017 14:09
@diasbruno

Copy link
Copy Markdown
Contributor Author

I tried to write all the docs, but metamagical was not happy and it could not parse the full comment. So this should be ready to merge.

Hope to take some time to hack with metamagical (seems pretty cool).
I'll provide the error I got later.

@robotlolita

Copy link
Copy Markdown
Member

No worries :) Thanks

@robotlolita
robotlolita merged commit 573c2bf into origamitower:master May 30, 2017
@ghost ghost removed the in progress label May 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants