Created
January 30, 2017 14:30
-
-
Save kazumalab/065c6997ef863bad4bf95ad1a5ce271a to your computer and use it in GitHub Desktop.
This file contains 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
using System.Collections.Generic; | |
public class Functor { | |
public static List<T> map<T> (System.Func<T, T> f, List<T> list) { | |
List<T> newList = new List<T> (); | |
foreach (var num in list) { | |
newList.Add (f (num)); | |
} | |
return newList; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment