A simple example showing that IO doesn’t satisfy the monad laws?
All monads in Haskell are only monads if you exclude the weird seq combinator. This is also true for IO. Since seq is not actually a regular function but involves magic, you have to exclude it from checking the monad laws for the same reason you have to exclude unsafePerformIO. Using seq you can prove … Read more