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

@@ -43,7 +43,7 @@ import (
// // Use file here
// return either.Right[error]("data")
// })
func WithResource[E, R, A any](onCreate func() Either[E, R], onRelease func(R) Either[E, any]) func(func(R) Either[E, A]) Either[E, A] {
func WithResource[E, R, A, ANY any](onCreate func() Either[E, R], onRelease Kleisli[E, R, ANY]) func(func(R) Either[E, A]) Either[E, A] {
return func(f func(R) Either[E, A]) Either[E, A] {
return MonadChain(
@@ -58,7 +58,7 @@ func WithResource[E, R, A any](onCreate func() Either[E, R], onRelease func(R) E
func(a A) Either[E, A] {
return F.Pipe1(
released,
MapTo[E, any](a),
MapTo[E, ANY](a),
)
})
},