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

fix: add missing ChainReaderIOK

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-10-06 23:02:45 +02:00
parent e313f95865
commit 254c63a16f
3 changed files with 53 additions and 0 deletions

View File

@@ -480,6 +480,34 @@ func ChainIOK[
return RIE.ChainIOK[GRA, GRB](f)
}
func MonadChainReaderIOK[
GRB ~func(context.Context) GIOB,
GRA ~func(context.Context) GIOA,
GRIO ~func(context.Context) GIO,
GIOA ~func() E.Either[error, A],
GIOB ~func() E.Either[error, B],
GIO ~func() B,
A, B any](ma GRA, f func(A) GRIO) GRB {
return RIE.MonadChainReaderIOK[GRA, GRB](ma, f)
}
func ChainReaderIOK[
GRB ~func(context.Context) GIOB,
GRA ~func(context.Context) GIOA,
GRIO ~func(context.Context) GIO,
GIOA ~func() E.Either[error, A],
GIOB ~func() E.Either[error, B],
GIO ~func() B,
A, B any](f func(A) GRIO) func(ma GRA) GRB {
return RIE.ChainReaderIOK[GRA, GRB](f)
}
func MonadChainFirstIOK[
GRA ~func(context.Context) GIOA,
GIOA ~func() E.Either[error, A],

View File

@@ -164,6 +164,14 @@ func Never[A any]() ReaderIOEither[A] {
return G.Never[ReaderIOEither[A]]()
}
func MonadChainReaderIOK[A, B any](ma ReaderIOEither[A], f func(A) RIO.ReaderIO[B]) ReaderIOEither[B] {
return G.MonadChainReaderIOK[ReaderIOEither[B], ReaderIOEither[A]](ma, f)
}
func ChainReaderIOK[A, B any](f func(A) RIO.ReaderIO[B]) func(ma ReaderIOEither[A]) ReaderIOEither[B] {
return G.ChainReaderIOK[ReaderIOEither[B], ReaderIOEither[A]](f)
}
func MonadChainIOK[A, B any](ma ReaderIOEither[A], f func(A) IO.IO[B]) ReaderIOEither[B] {
return G.MonadChainIOK[ReaderIOEither[B], ReaderIOEither[A]](ma, f)
}