Skip to content

Instantly share code, notes, and snippets.

@DeepSky8
Created March 21, 2016 20:16
Show Gist options
  • Save DeepSky8/fc67045fdbb041f4c513 to your computer and use it in GitHub Desktop.
Save DeepSky8/fc67045fdbb041f4c513 to your computer and use it in GitHub Desktop.
Not sure how to populate the IEnumerable 'result'
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Jacket
{
static class Program
{
static void Main(string[] args)
{
}
public static IEnumerable<T3> Zipper<T1, T2, T3>(this IEnumerable<T1> first, IEnumerable<T2> second, Func<T1, T2, T3> f)
{
IEnumerable<T3> result;
var FWalk = first.GetEnumerator();
var SWalk = second.GetEnumerator();
foreach (var item in first)
{
FWalk.MoveNext();
SWalk.MoveNext();
f(FWalk.Current, SWalk.Current);
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment