Skip to content

Instantly share code, notes, and snippets.

@joelmartinez
Created August 1, 2014 21:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joelmartinez/a527a9afd27607ef25bc to your computer and use it in GitHub Desktop.
Save joelmartinez/a527a9afd27607ef25bc to your computer and use it in GitHub Desktop.
A simple extension method that gives you the "Iter" function from F#
static class x10 {
public static IEnumerable<T> Iter<T>(this IEnumerable<T> list, Action<T> action) {
foreach (var n in list) {
action (n);
yield return n;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment