1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-27 22:28:29 +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

@@ -51,7 +51,7 @@ import "github.com/IBM/fp-go/v2/ioeither"
// result := withFile(func(f *File) ReaderIOEither[Config, error, string] {
// return readContent(f)
// })
func WithResource[A, L, E, R, ANY any](onCreate ReaderIOEither[L, E, R], onRelease func(R) ReaderIOEither[L, E, ANY]) func(func(R) ReaderIOEither[L, E, A]) ReaderIOEither[L, E, A] {
func WithResource[A, L, E, R, ANY any](onCreate ReaderIOEither[L, E, R], onRelease Kleisli[L, E, R, ANY]) Kleisli[L, E, Kleisli[L, E, R, A], A] {
return func(f func(R) ReaderIOEither[L, E, A]) ReaderIOEither[L, E, A] {
return func(l L) ioeither.IOEither[E, A] {
// dispatch to the generic implementation