Skip to content
  • Sylvain Henry's avatar
    Replace CPP assertions with Haskell functions · bfabf94f
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    There is no reason to use CPP. __LINE__ and __FILE__ macros are now
    better replaced with GHC's CallStack. As a bonus, assert error messages
    now contain more information (function name, column).
    
    Here is the mapping table (HasCallStack omitted):
    
      * ASSERT:   assert     :: Bool -> a -> a
      * MASSERT:  massert    :: Bool -> m ()
      * ASSERTM:  assertM    :: m Bool -> m ()
      * ASSERT2:  assertPpr  :: Bool -> SDoc -> a -> a
      * MASSERT2: massertPpr :: Bool -> SDoc -> m ()
      * ASSERTM2: assertPprM :: m Bool -> SDoc -> m ()
    bfabf94f