-
-
Save dterracino/b997f4ca2df494c30508c53b66417b4c 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