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

Mapping Some to None #5

Open
G4143 opened this issue Sep 2, 2019 · 0 comments
Open

Mapping Some to None #5

G4143 opened this issue Sep 2, 2019 · 0 comments

Comments

@G4143
Copy link

G4143 commented Sep 2, 2019

In your enclosed examples of mapping optional types, you don't have an example which maps a Some[value] to a None. How do you accomplish that?

Some["caterpillar!"].map(&:upcase) # => Some["CATERPILLAR!"]
None.map(&:upcase) # => None

How do I accomplish
Some["caterpillar!"].map(do something to produce a None) # => None

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

No branches or pull requests

1 participant