I just realised that many common monads do not obey the monad laws when
it comes to bottoms.

E.g. for the Reader monad:

  undefined >>= return /= undefined
  return () >>= undefined /= undefined
  return () >>= const undefined /= undefined
  return undefined >>= \x -> case x of () -> return () /= undefined

Not a long time ago David Barbour argued on this list that bottoms
should be ignored when checking the monad laws.

Is that the commonly accepted interpretation of the laws?
Is there any other interpretation in which the Reader monad obeys the
laws?

-- 
Roman I. Cheplyaka :: http://ro-che.info/

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to