Skip to content

Add implementation on Option is confusing #8127

Closed
@Kimundi

Description

@Kimundi

Right now add on two Options effectively treats a None as a Some(Zero::zero()), which is:

  • Unnecessary because Some(Zero::zero()) is already a valid value, why duplicate it's meaning with None?
  • Contrary to the way the Maybe Monad in Haskell works: If both values are a Some, add them, else return None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions