1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-23 22:14:53 +02:00

fix: serveral performance improvements

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2025-11-18 10:58:24 +01:00
parent 8a2e9539b1
commit 909d626019
49 changed files with 3321 additions and 337 deletions

View File

@@ -201,7 +201,7 @@ func TestSwap(t *testing.T) {
// Test MonadFlap and Flap
func TestFlap(t *testing.T) {
fab := Right[error](func(x int) string { return strconv.Itoa(x) })
fab := Right[error](strconv.Itoa)
result := MonadFlap(fab, 42)
assert.Equal(t, Right[error]("42"), result)
@@ -615,7 +615,7 @@ func TestMonad(t *testing.T) {
assert.Equal(t, Right[error](42), result)
// Test Map
mapFn := m.Map(func(x int) string { return strconv.Itoa(x) })
mapFn := m.Map(strconv.Itoa)
result2 := mapFn(Right[error](42))
assert.Equal(t, Right[error]("42"), result2)
@@ -628,7 +628,7 @@ func TestMonad(t *testing.T) {
// Test Ap
apFn := m.Ap(Right[error](42))
result4 := apFn(Right[error](func(x int) string { return strconv.Itoa(x) }))
result4 := apFn(Right[error](strconv.Itoa))
assert.Equal(t, Right[error]("42"), result4)
}