1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

initial checkin

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-07-07 22:31:06 +02:00
parent 71c47ca560
commit c07df5c771
128 changed files with 5827 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
package ord
import (
O "github.com/ibm/fp-go/ord"
S "github.com/ibm/fp-go/semigroup"
)
// Max gets a semigroup where `concat` will return the maximum, based on the provided order.
func Max[A any](o O.Ord[A]) S.Semigroup[A] {
return S.MakeSemigroup(O.Max(o))
}
// Min gets a semigroup where `concat` will return the minimum, based on the provided order.
func Min[A any](o O.Ord[A]) S.Semigroup[A] {
return S.MakeSemigroup(O.Min(o))
}