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

Add fromNullable method to Maybe #201

Closed
wants to merge 1 commit into from

Conversation

HeeL
Copy link

@HeeL HeeL commented Jul 20, 2018

Add Maybe.fromNullable

@HeeL
Copy link
Author

HeeL commented Jul 21, 2018

@robotlolita Coverage Check doesn't seem to recognize any of the branches I've tested. Do you know what might be the issue here and how I can fix this? Did I get the idea of your property-base testing correctly?

@robotlolita
Copy link
Member

Oh. Maybe already has a fromNullable defined (see https://github.com/origamitower/folktale/blob/master/packages/base/source/maybe/index.js#L38).

"static" functions go on the index.js module, and "instance" methods go on the maybe.js module. I suppose the structure and the way they're defined right now can be quite confusing :x

So, you've defined an instance method here, you'd only be able to call that with something like Maybe.of().fromNullable(value), the tests then end up calling the static function that is defined on index.js

@HeeL
Copy link
Author

HeeL commented Jul 23, 2018

I see, thank you for pointing this out

@HeeL HeeL closed this Jul 23, 2018
@HeeL HeeL deleted the add-fromNullable-to-maybe branch July 23, 2018 07:31
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.

2 participants