Hi,
How exactly do monads “solve” the problem of
referential transparency? I understand RT to be such that a function can be
replaced with a actual value.
Since a monad could potentially encapsulate any other value—say,
data read from a keyboard—doesn’t that violate the assumption of RT
on monads?
Or does RT ignore the encapsulated data and just view the “action”
performed by the monad as the “value” of the monad?
Just curious as to the rationale behind referential
transparency and how it applies to monads.
Cheers,
Mark Spezzano