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

Monad instance for Vector and Matrix #607

Merged
merged 3 commits into from
Sep 22, 2024
Merged

Conversation

cannorin
Copy link
Member

@cannorin cannorin commented Sep 19, 2024

This also makes Vector<_, 'n> and Matrix<_, 'm, 'n> monads.

ref: https://stackoverflow.com/questions/5802628/monad-instance-of-a-number-parameterised-vector

@cannorin
Copy link
Member Author

It looks like we must add >>= too since >>= is not automatically derived from join (but the converse is)

@cannorin cannorin requested a review from gusty September 19, 2024 10:35
Copy link
Member

@gusty gusty left a comment

Choose a reason for hiding this comment

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

Looks great, do you mind adding a basic test ?

@cannorin cannorin requested a review from gusty September 22, 2024 08:16
Copy link
Member

@gusty gusty left a comment

Choose a reason for hiding this comment

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

Cool, that's more than just basic tests, great job as always !

@gusty gusty changed the title Add join operator to Vector and Matrix Monad instance for Vector and Matrix Sep 22, 2024
@gusty gusty merged commit 43050e6 into master Sep 22, 2024
4 checks passed
wallymathieu pushed a commit that referenced this pull request Nov 11, 2024
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.

2 participants