fp-go
https://gyazo.com/415e517ba957d45ae9ee0f232c40743c
Goでfunctional programming This library is strongly influenced by the awesome fp-ts.
code:go
func TestReadMultipleFiles(t *testing.T) {
data := F.Pipe2(
A.MakeBy(3, idxToFilename),
R.TraverseArray(F.Flow3(
file.ReadFile,
R.ChainFirstIOK(IO.LogfRecordType("Log Single: %v")), )),
R.ChainFirstIOK(IO.Logf[[]RecordType]("Log Result: %v")),
)
result := data(context.Background())
assert.Equal(t, E.Oferror(A.From(RecordType{"file1"}, RecordType{"file2"}, RecordType{"file3"})), result()) }
ほんまにGo userに受けいられるのだろうかmrsekut.icon