Posts

Showing posts from August, 2010
Tuples in C# One of the new C# 4.0 enhancements is a Tuple class  that interests me as I'm currently trying to learn functional programming with F#.   If your like me your current production environment is likely to remain in 3.5 framework for some time.  This does not mean that we cannot take advantage of some of these enhancements.  A quick search of tuple in C# brought many examples including: 1: public class Tuple<T1, T2> : IEqualityComparer<Tuple<T1, T2>> 2: { 3: /// <summary> 4: /// First item 5: /// </summary> 6: public T1 First { get; private set; } 7:   8: /// <summary> 9: /// Second item 10: /// </summary> 11: public T2 Second { get; private set; } 12:   13: /// <summary> 14: /// Constructor 15: /// </summary> 16: public Tuple(T1 first, T2 second) 17: