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

fix: add auto generation for Eitherize

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-07-13 16:14:38 +02:00
parent 288422ecf1
commit b34f3e3ae1
20 changed files with 2200 additions and 1270 deletions

View File

@@ -52,6 +52,7 @@ func MonadFold[E, A, B any](ma Either[E, A], onLeft func(e E) B, onRight func(a
return onRight(ma.right)
}
// Unwrap converts an Either into the idiomatic tuple
func Unwrap[E, A any](ma Either[E, A]) (A, E) {
return ma.right, ma.left
}