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

fix: linter bugs

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2024-02-07 10:07:37 +01:00
parent 9b3d9c6930
commit 909f7c3bce
42 changed files with 184 additions and 103 deletions

View File

@@ -36,8 +36,8 @@ func (inner *Inner) getA() int {
return inner.A
}
func (inner *Inner) setA(A int) *Inner {
inner.A = A
func (inner *Inner) setA(a int) *Inner {
inner.A = a
return inner
}

View File

@@ -33,8 +33,8 @@ type Optional[S, A any] struct {
// modifying that copy
func setCopy[SET ~func(*S, A) *S, S, A any](setter SET) func(s *S, a A) *S {
return func(s *S, a A) *S {
copy := *s
return setter(&copy, a)
cpy := *s
return setter(&cpy, a)
}
}

View File

@@ -22,8 +22,8 @@ import (
O "github.com/IBM/fp-go/option"
)
// PrismAsOptional converts a prism into an optional
func PrismAsOptional[S, A any](sa P.Prism[S, A]) OPT.Optional[S, A] {
// AsOptional converts a prism into an optional
func AsOptional[S, A any](sa P.Prism[S, A]) OPT.Optional[S, A] {
return OPT.MakeOptional(
sa.GetOption,
func(s S, a A) S {
@@ -38,5 +38,5 @@ func PrismSome[A any]() P.Prism[O.Option[A], A] {
// Some returns a `Optional` from a `Optional` focused on the `Some` of a `Option` type.
func Some[S, A any](soa OPT.Optional[S, O.Option[A]]) OPT.Optional[S, A] {
return OPT.Compose[S](PrismAsOptional(PrismSome[A]()))(soa)
return OPT.Compose[S](AsOptional(PrismSome[A]()))(soa)
}