
On Thu, 2020-11-12 at 16:25 -0500, David Feuer wrote:
First, for clarity, note that
const id = flip const
Consider a (right-)occlusive functor. We immediately see that
liftA2 (flip const) m (pure x) = pure x
Using the Applicative laws, we can restate this:
x <$ m = pure x
We get the same sort of result for a left-occlusive effect.
So an occlusive effect can't have any *observable* side effects. It must be "read only".
I'd rather interpret this as a form of lazyness or call-by-need: If the action's return value is not used, then the side-effects are also not executed. Computationally, constant-ness of a function is an undecidable property. Therefore it is questionable whether any implementation can exhibit this sort of lazyness with side-effectful actions. Olaf