News for hackers. Stuff that matters.
Re:Making a Go program 70% faster with a one character change by foldr on Tuesday November 15, 2022 @04:23AM (#33607031)
Right, but Go doesn't have sum types, and I think it's a mistake to interpret Go's error handling conventions through that lens. It's perfectly fine to return an error together with a meaningful value. At least, I haven't been able to find any official Go docs suggesting otherwise. You might wish that Go had sum types, but that doesn't mean that it's an actual Go coding convention to pretend that (err, X) tuples are sum types.

There are no comments on this comment yet.