-
Notifications
You must be signed in to change notification settings - Fork 378
Add Group specification
#272
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
Conversation
| ### Group | ||
|
|
||
| A value that implements the Group specification must also implement | ||
| the [Monoid](#monoid) specification. |
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.
There's more than one way to get to group, but we definitely shouldn't let that get in the way of this PR
(We could eventually have
class Magma m where
concat :: m -> m -> m
class Magma m => Quasigroup m where
latin :: (m, m) -> (m, m)
class Magma m => Unital m where
empty :: () -> m
class Magma m => Semigroup m
class (Semigroup m, Unital m) => Monoid m
class (Quasigroup m, Unital m) => Loop m
class (Semigroup, Quasigroup, Unital m) => Group m
All (non-empty) associative quasigroups are groups, so there's no 8th member)
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.
Oh snap. I see some possible opportunities here for another couple PRs!
Good call!
|
@gabejohnson 🏫 me on how to get dat png updated. |
|
Also, I am not satisfied with the names EDIT: ANOTHER EDIT: |
|
Okay. Removed WIP, this is GTG and 🔴 👁 for review. |
figures/dependencies.dot
Outdated
| Functor -> Traversable; | ||
| Plus -> Alternative; | ||
| Semigroup -> Monoid; | ||
| Semigroup -> Monoid -> Group; |
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.
Please move this to a separate line, alphabetically please.
Functor -> Traversable;
Monoid -> Group;
Plus -> Alternative;
Semigroup -> Monoid;|
@joneshf addressed |
| Functor -> Extend; | ||
| Functor -> Profunctor; | ||
| Functor -> Traversable; | ||
| Monoid -> Group; |
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.
👍 Thanks!
|
Any other feedback or anything I should address that is keeping this from being merged in? |
|
What's the status of this one? It looks good :D |
|
Agreed. We can follow up if something is missing/wrong. |
|
A little late to the party. I think there's a small mistake
I think it should be either See https://github.com/fantasyland/fantasy-land#plus |
|
Good catch, @gabejohnson. See #275. |
A little
Grouptherapy for the massesThis PR addresses this issue by adding a specification for
Group. In addition to the new spec, I did the following to get the tests to work using "mocks" already in place:internal/string_sumtointernal/sumand modified it to work withNumberinstead ofString.monoidandtraverable.compositionspecs to accommodate the newlyNumberdependentSum.semigroupoidspec to run. The spec was not included in the specs, it is now.