1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-25 22:21:49 +02:00

fix: refactor

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2025-11-11 11:01:49 +01:00
parent 62fcd186a3
commit 600521b220
100 changed files with 1786 additions and 1618 deletions

View File

@@ -16,6 +16,7 @@
package iooption
import (
F "github.com/IBM/fp-go/v2/function"
"github.com/IBM/fp-go/v2/internal/apply"
"github.com/IBM/fp-go/v2/internal/chain"
"github.com/IBM/fp-go/v2/internal/functor"
@@ -224,9 +225,7 @@ func BindL[S, T any](
lens L.Lens[S, T],
f Kleisli[T, T],
) Kleisli[IOOption[S], S] {
return Bind[S, S, T](lens.Set, func(s S) IOOption[T] {
return f(lens.Get(s))
})
return Bind[S, S, T](lens.Set, F.Flow2(lens.Get, f))
}
// LetL attaches the result of a pure computation to a context using a lens-based setter.
@@ -259,9 +258,7 @@ func LetL[S, T any](
lens L.Lens[S, T],
f func(T) T,
) Kleisli[IOOption[S], S] {
return Let[S, S, T](lens.Set, func(s S) T {
return f(lens.Get(s))
})
return Let[S, S, T](lens.Set, F.Flow2(lens.Get, f))
}
// LetToL attaches a constant value to a context using a lens-based setter.