:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:
The original law, askUnliftIO >>= (\u -> liftIO (unliftIO u m)) = m, conflates two things in my opinion: the fact that askUnliftIO itself doesn't modify the state, and that liftIO/unliftIO are inverse operations. So I separated these two properties into separate laws and named these the "idempotency laws" since these laws claim that the MonadUnliftIO-specific operations should not have side effects, but rather should only do the work of inversing liftIO.
:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:
The original law,
askUnliftIO >>= (\u -> liftIO (unliftIO u m)) = m
, conflates two things in my opinion: the fact thataskUnliftIO
itself doesn't modify the state, and thatliftIO
/unliftIO
are inverse operations. So I separated these two properties into separate laws and named these the "idempotency laws" since these laws claim that theMonadUnliftIO
-specific operations should not have side effects, but rather should only do the work of inversingliftIO
.Let me know what you think!