@@ -1,6 +1,7 @@
1module Data.Matrix
1module Data.Matrix
3import Data.Complex
3import Data.Complex
5%default total
6%default total
@@ -215,7 +216,39 @@ instance Ring Float where
216instance RingWithUnity Float where
217instance RingWithUnity Float where
217 unity = 1
218 unity = 1
221+instance Semigroup Nat where
224+instance Monoid Nat where
227+instance VerifiedSemigroup Nat where
228+ semigroupOpIsAssociative = plusAssociative
230+instance VerifiedMonoid Nat where
231+ monoidNeutralIsNeutralL = plusZeroRightNeutral
232+ monoidNeutralIsNeutralR = plusZeroLeftNeutral
235+instance Semigroup ZZ where
238+instance Monoid ZZ where
241+instance Group ZZ where
244+instance AbelianGroup ZZ
246+instance Ring ZZ where
249+instance RingWithUnity ZZ where
220instance Semigroup a => Semigroup (Complex a) where
253instance Semigroup a => Semigroup (Complex a) where
221 (<+>) (a :+ b) (c :+ d) = (a <+> c) :+ (b <+> d)
254 (<+>) (a :+ b) (c :+ d) = (a <+> c) :+ (b <+> d)
@@ -233,17 +266,3 @@ instance (Num a, AbelianGroup (Complex a)) => Ring (Complex a) where
234instance (Num a, Ring (Complex a)) => RingWithUnity (Complex a) where
267instance (Num a, Ring (Complex a)) => RingWithUnity (Complex a) where
235 unity = (1 :+ 0)
268 unity = (1 :+ 0)
238−instance Semigroup Nat where
241−instance Monoid Nat where
244−instance VerifiedSemigroup Nat where
245− semigroupOpIsAssociative = plusAssociative
247−instance VerifiedMonoid Nat where
248− monoidNeutralIsNeutralL = plusZeroRightNeutral
249− monoidNeutralIsNeutralR = plusZeroLeftNeutral