On Wednesday, July 3, 2019 at 3:03:20 AM UTC+2, Gert wrote: > > https://github.com/golang/go/blob/master/src/errors/wrap.go > > What if we replaced all error types in that file with a empty interface or > a general monad interface? Can we make it work for other types too and > introduce a new monad package instead a new error package only? > > package monad
type Monad interface { Unwrap(m monad) monad Is(m, target monad) bool As(m monad, target interface{}) bool } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/676f1ceb-2704-4534-ac5b-70c033767fa9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.