Control.Exception.assert vs HsVersions.h's ASSERT?

RodLogic dev at
Tue Nov 11 19:34:02 UTC 2014

Having spent a bit of time staring at GHC's sources, I noticed that there
are around 140 modules using a set of C macros for assertions, namely:


However, I see that Control.Exception already provides a first class
Haskell assertion function:

assert :: Bool -> a -> a

that is turned off automatically when optimizations are turned on, and
provides an error containing the filename and line number, which was why I
thought the above macros existed and were still in use.

My question is: is there any reason to keep using these macros instead of
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list