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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result is a Functor now #5

Merged
merged 1 commit into from
May 18, 2019
Merged

Conversation

nateabele
Copy link

Add Fantasy Land-compliant map() methods for Ok and Err, for functional programming happiness.

I had to patch the test helper functions to account for instance methods. I could have sworn Chai was smart enough to ignore stuff on prototypes, but, 馃し鈥嶁檪.

The other, possibly more semantic option is to assert that deep.equal(new Ok(expectedValue)) and deep.equal(new Err(expectedErrorMsg)). Your call.

@nateabele nateabele mentioned this pull request May 17, 2019
@joanllenas joanllenas merged commit 0ce9578 into joanllenas:master May 18, 2019
@nateabele nateabele deleted the functors branch November 9, 2019 13:52
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