Badges
Tags
Categories
Meta
Tag Archives: f#
Replacing the for loop with Seq.iter
Here’s the initial function in C#: public string BuildQuery(IEnumerable<KeyValuePair<string, string>> args) { var coll = HttpUtility.ParseQueryString(String.Empty, _urlEncoder); foreach (var arg in args) { coll.Add(arg.Key, arg.Value); } return coll.ToString(); } First I rewrote it in F# the following pretty naïve way, … Continue reading
