Skip to content

Proposal: Add intermediate monadic types for option and generated results e.g. OptionNone with implicite conversion to Option<T> to enhance type inference #38

@Tyrrx

Description

@Tyrrx

C# has very limited type inference. An intermediate monadic type representation would support C#'s type inference. For instance returning a OptionNone from Option.None that will be implicitly converted to an Option as soon as it is passed to an already strong typed method. This could be just an extension as Option.None<T> could still return Option<T>.

// struct Option<T>: 
public static implicit operator Option<T>(OptionNone value) =>
            Option<T>.None;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions