Skip to content

Instantly share code, notes, and snippets.

@ashmind
Created March 11, 2011 23:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashmind/866786 to your computer and use it in GitHub Desktop.
Save ashmind/866786 to your computer and use it in GitHub Desktop.
Monoids in C# as I see them
public class Monoid<T> {
public T None { get; private set; }
public Func<T, T, T> Operation { get; private set; }
public Monoid(Func<T,T,T> operation, T none) {
this.Operation = operation;
this.None = none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment