mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +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
|
||||
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
|
||||
Semigroup Ordering where
|
||||
LT <+> _ = LT
|
||||
|
Loading…
Reference in New Issue
Block a user