/// <summary>
 /// Constructor that creates a cons cell with an element
 /// (head) and a reference to the rest of the list (tail)
 /// </summary>
 /// <param name="head">The elemnet stored by the cons cell</param>
 /// <param name="tail">Reference to the rest of the list</param>
 public FuncList(T head, FuncList <T> tail)
 {
     IsEmpty = false;
     Head    = head;
     Tail    = tail;
 }
 /// <summary>
 /// Creates a cons cell storing an element of the list.
 /// This method can be used without specifying generic
 /// type parameters thanks to the C# type inference.
 /// </summary>
 public static FuncList <T> Cons <T>(T head, FuncList <T> tail)
 {
     return(new FuncList <T>(head, tail));
 }
 public static FuncList <R> Select <T, R>(this FuncList <T> source, Func <T, int, R> f)
 {
     return(SelectUtil(source, 0, f));
 }
 /// <summary>
 /// Constructor that creates a cons cell with an element
 /// (head) and a reference to the rest of the list (tail)
 /// </summary>
 /// <param name="head">The elemnet stored by the cons cell</param>
 /// <param name="tail">Reference to the rest of the list</param>
 public FuncList(T head, FuncList <T> tail)
 {
     this.IsEmpty = false;
     this.Head    = head;
     this.Tail    = tail;
 }