mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-26 13:11:30 +03:00
[ prelude ] Implement Semigroup
for ordinary pairs
This commit is contained in:
parent
257783275e
commit
5d70c746b1
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user