fx-sharp  0.1
A collection of functional extensions for C#.
 All Classes Namespaces Files Functions Variables Enumerator
Prelude.cs
Go to the documentation of this file.
1 namespace FxSharp
2 {
3  public static class Prelude
4  {
5  /// <summary>
6  /// The identity function.
7  /// </summary>
8  /// <typeparam name="T"></typeparam>
9  /// <param name="t"></param>
10  /// <returns></returns>
11  public static T Id<T>(T t)
12  {
13  return t;
14  }
15 
16  /// <summary>
17  /// A binary function that always returns its first argument.
18  /// </summary>
19  /// <typeparam name="T"></typeparam>
20  /// <param name="a"></param>
21  /// <param name="b"></param>
22  /// <returns></returns>
23  public static T Const<T>(T a, T b)
24  {
25  return a;
26  }
27  }
28 }