Option<T> and implicit conversion · Issue #25 · micro-elements/MicroElements.Functional · GitHub
Skip to content

Option<T> and implicit conversion #25

Open

Description

@mickvikt

Hello,
It would be really nice if one could configure Option not to do implicit conversion from a value to Some(value). Sometimes declaring intent explicitly is really useful. Is that possible?

Thank you.

Activity

  1. petriashev commented on Mar 19, 2021

    @petriashev
    Member

    This behaviour is the same as in one of the most featured lib LanguageExt.
    It allows easily convert ordinary method to optional with minimal code changes and back. The same is for result return type - you can return one type or another.

    What is your use case when you dont need implicit conversion?

  2. mickvikt commented on Mar 19, 2021

    @mickvikt
    Author

    Well, it lacks explicit clearness when you're, say, doing a code review on Azure DevOps pull request, an Option variable is declared earlier and all you see further down the code is:

    someVariable = 42

    This gives no indication of intent that this is an Option and not a simple int.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions