Ticket #107 (new enhancement)
Add assertions
| Reported by: | guest | Owned by: | none |
|---|---|---|---|
| Milestone: | Keywords: | assertion | |
| Cc: | Section: | ||
| State: |
Description
GHC currently has a nice feature for assertions, which allow the programmer to insert a condition which is asserted to be true. If the condition is in fact false, an error is raised which contains the source code line of the assertion. A compiler flag allows all assertions to be disabled.
http://www.haskell.org/ghc/docs/latest/html/users_guide/sec-assertions.html
Possible variations:
- Have a form of 'assert' which can take an arbitrary string to which the source file location is prepended.
- assert can tie in to imprecise exceptions, if they are adopted, or a failed assertion can be bottom
- Remove the source line feature (makes the proposal simpler, but less useful because now all you get is the compiler flag to turn assertions off)
Change History
Note: See
TracTickets for help on using
tickets.
