Created
August 1, 2014 21:26
-
-
Save joelmartinez/a527a9afd27607ef25bc to your computer and use it in GitHub Desktop.
A simple extension method that gives you the "Iter" function from F#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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