-
Notifications
You must be signed in to change notification settings - Fork 10
Add the Align, Alignable and Crosswalk classes #29
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
Add the Align, Alignable and Crosswalk classes #29
Conversation
I'm not familiar with these type classes myself. However, I do see laws from Haskell, which would be useful to be added to the class documentation comments (as is done for other classes in PureScript, like
The new dependencies are not a problem :) |
As a quick response, you can think of For example, given: even ::
Int ->
Data.Maybe.Maybe Int
even x =
if mod x 2 == 0 then
Data.Maybe.Just x
else
Data.Maybe.Nothing Where
I.e. It takes everything "failing" to "fail" All of the caveats around the generality of |
I added quickcheck laws and tests for the instance laws. Also added some module documentation and examples. I did not add documentation to |
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! I think with the arrays
, lists
, and quickcheck
dependencies we'll need to update the package-sets
spago file for this library when we bump its version on release.
I did not add documentation to README.md/docs. I think I would rather tackle that in a subsequent PR, such that I also add some docs for
These
as well.
No problem.
Huge thanks to @joneshf , the initial issue was quite clear, and the examples you posted a couple of days ago were great! |
Thank you for putting this together! |
If people are up to it, I'd like to bikeshed the names–in particular |
I don’t mind, and I don’t think there’s any particular urgency that would force the issue. What do you have in mind? |
I like I like that it has OTOH, this feels very close to being some sort of mix between |
I went down quite the rabbit-hole on this one. Ended up at this comment by @masaeedu and this Stack Overflow question. Haven't really gathered all my thoughts, but agree that there's something between The linked comment talk about how In any case, it sparks the idea that if there were something like |
@Vladciobanu @joneshf I've added the |
I don't really have a suggestion, and it doesn't look like there's much discussion going on, so don't hold anything up. |
Description of the change
Looking for early feedback.
I tried to implement the classes described in #21 to the best of my knowledge, using the Haskell implementation as an example.
I am looking for early feedback on
ordered-collections
forMap
instance for example),Feel free to ask me to add more documentation or tests before providing any feedback (although I would rather wait on those until I get a 👍 ).
Fixes #21
Checklist: