Skip to content

Mapping Some to None #5

Description

@G4143

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions