Is it possible to write this lambda in a more generic way? It works fine, but seems too specifically typed; the content of the IEnumerable
s are not touched, but should be preserved in the return type.
static readonly Func<
(IEnumerable<string>, IEnumerable<string>),
(IEnumerable<string>, IEnumerable<string>),
(IEnumerable<string>, IEnumerable<string>)
> JoinListTuples = (a, b) =>
(a.Item1.Concat(b.Item1),
b.Item2.Concat(b.Item2));
I was thinking of something like this, but it doesn't compile:
static readonly Func<
(IEnumerable<T>, IEnumerable<U>),
(IEnumerable<T>, IEnumerable<U>),
(IEnumerable<T>, IEnumerable<U>)
> JoinListTuples = (a, b) =>
(a.Item1.Concat(b.Item1),
b.Item2.Concat(b.Item2));