The ReaderResult monad is a specialized implementation of the Reader monad pattern for Go. It is designed for functions that depend on context.Context (for cancellation, deadlines, or context values) and may return an error. It allows you to write functions in a functional, declarative style while maintaining idiomatic Go error handling and context awareness.
It is functionally equivalent to the standard Go pattern func(ctx context.Context) (A, error), but wrapped to enable monadic composition.
type ReaderResult[A any] func(context.Context) (A, error)