Opened 12 years ago

Last modified 2 years ago

#107 new enhancement

Add assertions

Reported by: Owned by: none
Priority: normal Milestone:
Version: Keywords: assertion
Cc: Meta Owner:
State: discussion Section: N/A or multiple
Related Tickets:

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 (3)

comment:1 Changed 12 years ago by

component: HaskellPrimeProposal
Owner: changed from ijones to none

comment:2 Changed 2 years ago by Herbert Valerio Riedel

Milestone:

moving non-milestoned many year old legacy tickets out of the way

comment:3 Changed 2 years ago by Herbert Valerio Riedel

Priority: minornormal

Set default priority (as this confuses Trac otherwise)

Note: See TracTickets for help on using tickets.