Roll our own assert framework
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Current status:
- We use Haskell's built-in `assert` functionality, which is toggled at compile time with optimization level and/or `-f(no-)ignore-assert`
- We have a compile-time package flag which triggers expensive asserts or not
Problems with the current approach:
- You have to do some unnatural work to extend the built-in asserts with more useful information, because GHC doesn't make available a boolean "you compiled with asserts enabled". The "usual" way of doing it is to catch the thrown AssertionError and then rewrite it with extra information, but this is awfully indirect
Proposed alternate approach:
- We add a specific new flag to Cabal, cabal-install specifically for enabling asserts
- We build our own infrastructure using CallStack to throw assert failures
Contributor guide
Assessment
This issue has not been assessed yet.