[ prelude ] Implement Semigroup for ordinary pairs

This commit is contained in:
Denis Buzdalov 2021-09-03 16:39:22 +03:00 committed by G. Allais
parent 257783275e
commit 5d70c746b1

View File

@ -44,6 +44,14 @@ public export
Monoid () where Monoid () where
neutral = () neutral = ()
public export
Semigroup a => Semigroup b => Semigroup (a, b) where
(x, y) <+> (v, w) = (x <+> v, y <+> w)
public export
Monoid a => Monoid b => Monoid (a, b) where
neutral = (neutral, neutral)
public export public export
Semigroup Ordering where Semigroup Ordering where
LT <+> _ = LT LT <+> _ = LT