[Haskell-cafe] Re: [Haskell] Announce: generating free theorems, online and offline

Ryan Ingram ryani.spam at gmail.com
Thu Oct 18 02:56:43 EDT 2007


On 10/17/07, Janis Voigtlaender <voigt at tcs.inf.tu-dresden.de> wrote:
> Okay, it is quite natural to take this stand. But as you say, there is
> no such commitment in the language definition. And even if there were, I
> doubt it would be possible to enforce such invariants in a compiler. So
> there would be "illegal" programs that are nevertheless accepted by the
> compilers. Not what we want, do we, in Haskell land?

These invariants are basically impossible to enforce by the compiler,
but nonetheless certain classes have laws which are expected to hold,
and I would not be surprised if (for example) GHC optimization RULES
depended on them.  For example, there's no way to enforce that the
implementation of >>= is associative, but it's nonetheless stated in
the description of Monad and code assumes it to be true.

  -- ryan


More information about the Haskell-Cafe mailing list