Created
March 11, 2011 23:15
-
-
Save ashmind/866786 to your computer and use it in GitHub Desktop.
Monoids in C# as I see them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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