-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
everything #3
everything #3
Conversation
8a47feb
to
7c9ca16
Compare
test/of.js
Outdated
@@ -0,0 +1,17 @@ | |||
'use strict'; | |||
|
|||
var M = require('..'); |
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.
It would be nice to be able to write var Maybe = require('sanctuary-maybe')
without needing .Maybe
at the end. :)
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.
I agree, how would we do that though? How would a use create a Just
or a Nothing
?
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.
Are you suggesting I add Just
and Nothing
to Maybe
's prototype?
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.
We could attach Just
and Nothing
to Maybe
. The downside would be we'd then have both S.Nothing
and S.Maybe.Nothing
in Sanctuary. It may not be a good idea after all. Let's stick with M
for now. :)
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.
Yeah, makes sense, there'll be plenty more iterations to nail this down. :)
test/of.js
Outdated
eq(mOf.length, 1); | ||
// eq(mOf.toString(), 'of :: Applicative f => TypeRep f -> a -> f a'); | ||
|
||
eq(mOf(42), M.Just(42)); |
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.
I think this is the only test we need for of
:
eq(Z.of(Maybe, 42), Maybe.Just(42));
test/internal/eq.js
Outdated
var assert = require('assert'); | ||
|
||
var equals = require('./equals'); | ||
var toString = require('./toString'); |
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.
Why not require sanctuary-type-classes directly and use Z.toString
?
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.
Because I just copied and pasted this bit to get the of
test working for the moment. ;)
what about fantasyland/fantasy-maybes#8 ? |
Yeah, we discussed it here: |
@@ -0,0 +1,463 @@ | |||
(function(f) { |
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.
Let's add this:
// ,______ ______, ,________,,_____,,_____,,__________ ,__________,
// | \/ | | || || || \ | |
// |_, ,_| |_ _||_ || _||_, __ ||_, _____|
// | \ / | / \ \ \/ / | / | |
// ,_| || |_,,_/ /\ \_, \ / ,_| __ \ ,_| ___|_,
// | || || || | | | | || |
// |______||______||_____||_____| |____| |__________/ |__________|
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.
⚡
index.js
Outdated
'sanctuary-def', | ||
'sanctuary-type-classes', | ||
'sanctuary-type-identifiers' | ||
]; |
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.
index.js
Outdated
|
||
// readmeUrl :: String -> String | ||
function readmeUrl(id) { | ||
var version = '0.12.0'; // updated programmatically |
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.
Let's change this to '0.0.0'
.
7c9ca16
to
7a1748c
Compare
Addressed the comments and added the |
I think so. It's a little hard for me to know what you changed. It's probably a good idea to treat your branch as append-only for the time being. :) It might be helpful to consult sanctuary-js/sanctuary-either#3. The two pull requests should end up being very similar in many respects. |
Yeah, I won't squash commits for now. The only thing I added was |
That file LGTM. :) |
Are you happy for me to push commits to your branch, Stefano? |
Yeah, go for it. |
Final tests are in now. |
8171b40
to
5f4b5f3
Compare
Looking good! |
What else do we need to do here? |
The next step, Stefano, is to merge sanctuary-js/sanctuary-identity#3. We can then release |
What's the status on this pull request? |
I've been waiting to find time to wrap up three pull requests on which this pull request depends:
I've found some time today. I hope to release sanctuary-maybe by the end of February. 🤞 |
I'm about to squash the commits. The original commits can be found at |
Co-authored-by: Stefano Vozza <[email protected]>
7c6471b
to
64cc690
Compare
The only purpose of this PR is for me to have a place to ask questions about the splitting out of Maybe from the main Sanctuary code base. Ignore the contents of
index.js
for the moment, I pretty much just ripped the Maybe code out from Sanctuary and deleted everything unrelated.My initial question is about how to do the tests. Look at the tests for
of
. Should I use Sanctuary to invoke the method or should I useMaybe['fantasyland/of].of(1)
? If the latter, is it OK to create an alias like this and reuse it throughout the test:Also, I get a strange output from the
toString
function, which is why it's commented out:Looks like something to do with the code coverage.
One last thing, does CircleCI have to be enabled on this repo?