A Reader helps in solving the problem of passing down the same values to many functions. If there are computations that read value from a shared environment or configurations to be passed around, a Reader can be used in all such cases. It is also often used as a way of doing dependency injections.
A Reader expects an environment or a context to run, the run function takes in a Reader and the context it expects and returns the result of the computation.
Returns a Reader that when run with a context value gives back the context value as is.
Returns a Reader that when run will produce the value provided, no matter what the context.
Modify the context of a Reader
Represents a computation that expects a context that when run returns the result of the computation.