1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-29 22:38:29 +02:00

fix: initial release

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-07-17 18:03:21 +02:00
parent 69c2fe1118
commit 2efe4f64c5
18 changed files with 890 additions and 115 deletions

View File

@@ -22,6 +22,10 @@ func generateOptionSequenceTuple(f *os.File, i int) {
generateSequenceTuple1(optionHKT, "")(f, i)
}
func generateOptionSequenceT(f *os.File, i int) {
generateSequenceT1(optionHKT, "")(f, i)
}
func generateOptionize(f *os.File, i int) {
// Create the optionize version
fmt.Fprintf(f, "\n// Optionize%d converts a function with %d parameters returning a tuple of a return value R and a boolean into a function with %d parameters returning an Option[R]\n", i, i, i)
@@ -162,6 +166,8 @@ func optionize[R any](f func() (R, bool)) Option[R] {
generateOptionize(f, i)
// unoptionize
generateUnoptionize(f, i)
// sequenceT
generateOptionSequenceT(f, i)
// sequenceTuple
generateOptionSequenceTuple(f, i)
// traverseTuple