Commits

Tony Morris  committed b7ad1c6

More instances

  • Participants
  • Parent commits 768d8f6

Comments (0)

Files changed (1)

File Data/Semigroup.hs

 instance (Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) where
   (a1, b1, c1) .++. (a2, b2, c2) = (a1 .++. a2, b1 .++. b2, c1 .++. c2)
 
+instance (Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) where
+  (a1, b1, c1, d1) .++. (a2, b2, c2, d2) = (a1 .++. a2, b1 .++. b2, c1 .++. c2, d1 .++. d2)
+
+instance (Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) where
+  (a1, b1, c1, d1, e1) .++. (a2, b2, c2, d2, e2) = (a1 .++. a2, b1 .++. b2, c1 .++. c2, d1 .++. d2, e1 .++. e2)
+
+instance Semigroup Ordering where
+  a .++. b = run (Identity a .++. Identity b)
+
 instance Semigroup All where
   a .++. b = run (Identity a .++. Identity b)