Skip to content

Commit 5d70c74

Browse files
buzdengallais
authored andcommitted
[ prelude ] Implement Semigroup for ordinary pairs
1 parent 2577832 commit 5d70c74

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libs/prelude/Prelude/Interfaces.idr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ public export
4444
Monoid () where
4545
neutral = ()
4646

47+
public export
48+
Semigroup a => Semigroup b => Semigroup (a, b) where
49+
(x, y) <+> (v, w) = (x <+> v, y <+> w)
50+
51+
public export
52+
Monoid a => Monoid b => Monoid (a, b) where
53+
neutral = (neutral, neutral)
54+
4755
public export
4856
Semigroup Ordering where
4957
LT <+> _ = LT

0 commit comments

Comments
 (0)