Open
Description
type Foldable[T any, U any] interface { leftValue() T rightValue() U hasLeftValue() bool }
here is the my case:
1: I build a mo.Either base on a if/else, saying Either[A,B], A and B implement same interface C
2: I build a Foldable from the either. but I want to execute same function on the foldable.
right now the API must pass in two method "successFunc" and "failureFunc", for the case i describe seems redundant
by the way, of course, I can use case assert cast A or B to C. and then call the method.
Metadata
Assignees
Labels
No labels