[Haskell-beginners] Enforcing Monad Laws

Jorden M jrm8005 at gmail.com
Thu Jul 1 21:19:30 EDT 2010


Hello,

C++ `Concepts', which almost made it into the C++0x standard, are
roughly similar to Haskell type classes. The proposal for concepts in
C++ had a feature called axioms, which allow the programmer to specify
semantics on the functions the concept contains. This allows for
enforcing things such as the Monad Laws, as well as letting the
compiler make certain optimizations it may not have been able to make
without axiomatic guarantees. Why does Haskell not have a similar
functionality in its type classes? Was there not time, desire, etc.?
Or are there technical limitations?

Thanks,
~j


More information about the Beginners mailing list