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

fix: add missing Flatten to Reader

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-09-20 17:53:45 +02:00
parent 226c7039de
commit e8fdbe9f87
5 changed files with 28 additions and 0 deletions

View File

@@ -124,3 +124,7 @@ func Memoize[GEA ~func(E) GA, GA ~func() A, E, A any](rdr GEA) GEA {
}
}
}
func Flatten[GEA ~func(R) GIOA, GGEA ~func(R) GIOEA, GIOA ~func() A, GIOEA ~func() GEA, R, A any](mma GGEA) GEA {
return MonadChain(mma, F.Identity[GEA])
}