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

fix: add support for context sensitive readers

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-07-14 23:52:14 +02:00
parent 5020437b6a
commit 84c3e3ff88
101 changed files with 4440 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
package Exec
package exec
import (
"context"

View File

@@ -1,21 +1,21 @@
package either
import (
Apply "github.com/ibm/fp-go/internal/apply"
"github.com/ibm/fp-go/internal/apply"
T "github.com/ibm/fp-go/tuple"
)
// SequenceT converts n inputs of higher kinded types into a higher kinded types of n strongly typed values, represented as a tuple
func SequenceT1[E, A any](a Either[E, A]) Either[E, T.Tuple1[A]] {
return Apply.SequenceT1(
return apply.SequenceT1(
Map[E, A, T.Tuple1[A]],
a,
)
}
func SequenceT2[E, A, B any](a Either[E, A], b Either[E, B]) Either[E, T.Tuple2[A, B]] {
return Apply.SequenceT2(
return apply.SequenceT2(
Map[E, A, func(B) T.Tuple2[A, B]],
Ap[T.Tuple2[A, B], E, B],
@@ -24,7 +24,7 @@ func SequenceT2[E, A, B any](a Either[E, A], b Either[E, B]) Either[E, T.Tuple2[
}
func SequenceT3[E, A, B, C any](a Either[E, A], b Either[E, B], c Either[E, C]) Either[E, T.Tuple3[A, B, C]] {
return Apply.SequenceT3(
return apply.SequenceT3(
Map[E, A, func(B) func(C) T.Tuple3[A, B, C]],
Ap[func(C) T.Tuple3[A, B, C], E, B],
Ap[T.Tuple3[A, B, C], E, C],
@@ -34,7 +34,7 @@ func SequenceT3[E, A, B, C any](a Either[E, A], b Either[E, B], c Either[E, C])
}
func SequenceT4[E, A, B, C, D any](a Either[E, A], b Either[E, B], c Either[E, C], d Either[E, D]) Either[E, T.Tuple4[A, B, C, D]] {
return Apply.SequenceT4(
return apply.SequenceT4(
Map[E, A, func(B) func(C) func(D) T.Tuple4[A, B, C, D]],
Ap[func(C) func(D) T.Tuple4[A, B, C, D], E, B],
Ap[func(D) T.Tuple4[A, B, C, D], E, C],