Created
October 24, 2013 20:21
-
-
Save archena/7144315 to your computer and use it in GitHub Desktop.
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
interface Semigroup<T> { | |
T apply(T a, T b); | |
} | |
interface Monoid<T> extends Semigroup<T> { | |
T identity(); | |
} | |
interface Group<T> extends Monoid<T> { | |
T inverse(T a); | |
} | |
class Ring<T> { | |
public final Monoid<T> m; | |
public final Group<T> a; | |
public Ring(Monoid<T> m, Group<T> a) { | |
this.m = m; | |
this.a = a; | |
} | |
} | |
class Field<T> { | |
public final Group<T> m, a; | |
public Field(Group<T> m, Group<T> a) { | |
this.m = m; | |
this.a = a; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment