mirror of
https://github.com/IBM/fp-go.git
synced 2025-06-23 00:27:49 +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:
15
reader/array.go
Normal file
15
reader/array.go
Normal file
@ -0,0 +1,15 @@
|
||||
package reader
|
||||
|
||||
import (
|
||||
G "github.com/ibm/fp-go/reader/generic"
|
||||
)
|
||||
|
||||
// TraverseArray transforms an array
|
||||
func TraverseArray[R, A, B any](f func(A) Reader[R, B]) func([]A) Reader[R, []B] {
|
||||
return G.TraverseArray[Reader[R, B], Reader[R, []B], []A](f)
|
||||
}
|
||||
|
||||
// SequenceArray converts a homogeneous sequence of either into an either of sequence
|
||||
func SequenceArray[R, A any](ma []Reader[R, A]) Reader[R, []A] {
|
||||
return G.SequenceArray[Reader[R, A], Reader[R, []A]](ma)
|
||||
}
|
Reference in New Issue
Block a user