macaw-base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Macaw.Internal

Description

Items in this module should not be considered part of macaw-base's API, they are exported only for the sake of the test suite.

Synopsis

Documentation

assertionsEnabled :: IO Bool Source #

Check if assertions are enabled.

Note [Asserts]: When optimizations are enabled, GHC compiles assert to a no-op. However, Cabal enables -O1 by default. Therefore, if we want our assertions to be checked by our test suite, we must carefully ensure that we pass the correct flags to GHC for the lib:macaw-base target. We verify that we have done so by asserting as much in the test suite.

See also:

  • cabal.project.werror for the -fno-ignore-asserts flag