Ticket #107 (new enhancement)

Opened 6 years ago

Last modified 6 years ago

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:

  1. Have a form of 'assert' which can take an arbitrary string to which the source file location is prepended.
  2. assert can tie in to imprecise exceptions, if they are adopted, or a failed assertion can be bottom
  3. 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

Changed 6 years ago by guest

  • owner changed from ijones to none
  • component changed from HaskellPrime to Proposal
Note: See TracTickets for help on using tickets.