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

Implements Monoid interface/typeclass. #26

Merged

Conversation

drupol
Copy link
Collaborator

@drupol drupol commented Oct 19, 2021

Copy link
Owner

@marcosh marcosh left a comment

Choose a reason for hiding this comment

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

please rebase over master (I force pushed...)

namespace Marcosh\LamPHPda\Typeclass;

/**
* @psalm-immutable
Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Job done!

*
* @return Monoid<A>
*/
public static function mempty(): Monoid;
Copy link
Owner

Choose a reason for hiding this comment

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

mempty should return something of type A

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Job done!

Stupid question, where do you get this information from? Where is it documented that mempty should return A ?

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Excellent, thanks!!!

@drupol drupol force-pushed the feat/implements-monoid-interface-typeclass branch from 27c4ae0 to cfbf453 Compare October 21, 2021 07:10
@drupol drupol marked this pull request as ready for review October 21, 2021 07:22
@marcosh marcosh merged commit 05ea75d into marcosh:master Oct 22, 2021
@drupol drupol deleted the feat/implements-monoid-interface-typeclass branch October 22, 2021 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monoid implementations
2 participants