Closed effinsky closed 1 year ago
I suppose we can add a mo.Errf()
helper, but your first feedback is due to compiler limitation. Go is not able to infer Err
generic type from the output generic type (here Result[string]
).
I know -- it hurts!
Added to v1.10.0
I realize this is a limitation of the compiler's type inference mechanism but it looks bad to have to explicitly state a type parameter for the
None
andErr
variants. Can anything be done to avoid this and clean up the use ofOption
andResult
?Here's what I mean for
Result
, for instance:Here's what would be cooler:
Ok, and here's what would be really nice, with options for wrapping this: