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

Implement S.add and S.sub #133

Merged
merged 1 commit into from
Jan 27, 2016

Conversation

svozza
Copy link
Member

@svozza svozza commented Jan 26, 2016

As discussed in #127 .

@svozza svozza force-pushed the add-subtract-functions branch 3 times, most recently from 90e9689 to 847db85 Compare January 26, 2016 23:23
//. 2
//. ```
S.add =
def('add',
Copy link
Member

Choose a reason for hiding this comment

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

⬅️ ⬅️

@davidchambers
Copy link
Member

Is there value in using the same names as sanctuary-int, do you think? We use add and sub in that project.

@svozza
Copy link
Member Author

svozza commented Jan 26, 2016

Yeah, I guess it doesn't do any harm to be consistent. I was just following the naming convention from Ramda.

[$.FiniteNumber, $.FiniteNumber, $.FiniteNumber],
function(a, b) { return a + b; });

//# subtract :: FiniteNumber -> FiniteNumber -> FiniteNumber
Copy link
Member

Choose a reason for hiding this comment

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

s/subtract/sub/

Could you update the commit message and pull request title to match? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Way ahead of you. 😉

@svozza svozza changed the title Implement S.add and S.subtract Implement S.add and S.sub Jan 26, 2016
errorEq(TypeError,
'‘sub’ expected a value of type FiniteNumber ' +
'as its second argument; received "xxx"'));
});
Copy link
Member

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 use an infinite number in one of these tests. ∞


//# add :: FiniteNumber -> FiniteNumber -> FiniteNumber
//.
//. Adds two finite numbers together.
Copy link
Member

Choose a reason for hiding this comment

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

For the descriptions, I like:

  • Returns the sum of two (finite) numbers.
  • Returns the difference between two (finite) numbers.

@svozza
Copy link
Member Author

svozza commented Jan 27, 2016

⚡ x 3

//. Returns the sum of two (finite) numbers.
//.
//. ```javascript
//. > S.add(1, 1);
Copy link
Member

Choose a reason for hiding this comment

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

s/;//

@svozza
Copy link
Member Author

svozza commented Jan 27, 2016

⚡ x 2

@davidchambers
Copy link
Member

🌳

davidchambers added a commit that referenced this pull request Jan 27, 2016
@davidchambers davidchambers merged commit 574be1d into sanctuary-js:master Jan 27, 2016
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.

None yet

2 participants