Skip to content

Missing SelectMany overload #26

@j2jensen

Description

@j2jensen

The following LINQ fails to resolve an appropriate SelectMany method:

from val in Maybe.From("1")
from val2 in Maybe.From("2")
from val3 in new[] { 1, 2, 3}
select val3

We need a method on Maybe that's equivalent to this extension method signature:

public static IEnumerable<TResult> SelectMany<TSource, TOther, TResult>(this Maybe<TSource> source, 
	Func<TSource, IEnumerable<TOther>> otherSelector, 
	Func<TSource, TOther, TResult> resultSelector)

An acceptable short-term workaround is to change the Maybe to a List:

from val in Maybe.From("1").ToList()
from val2 in Maybe.From("2")
from val3 in new[] { 1, 2, 3}
select val3

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