assert-failure: Syntactic sugar improving 'assert' and 'error'

[ bsd3, contract, control, library ] [ Propose Tags ]

This library contains syntactic sugar that improves the usability of assert and error. This is actually a bunch of hacks wrapping the original assert function, see inside.

See also http://hackage.haskell.org/package/loch, http://hackage.haskell.org/package/assert and https://ghc.haskell.org/trac/ghc/ticket/5273.


[Skip to Readme]
Versions [RSS] [faq] 0.1, 0.1.1.0, 0.1.2.0, 0.1.2.1, 0.1.2.2, 0.1.2.3, 0.1.2.4, 0.1.2.5
Dependencies base (==4.*), pretty-show (>=1.6 && <2), text (>=0.11.2.3 && <2) [details]
License BSD-3-Clause
Author Mikolaj Konarski
Maintainer Mikolaj Konarski <mikolaj.konarski@funktory.com>
Category Control, Contract
Home page https://github.com/Mikolaj/assert-failure
Bug tracker https://github.com/Mikolaj/assert-failure/issues
Source repo head: git clone git://github.com/Mikolaj/assert-failure.git
Uploaded by MikolajKonarski at 2014-03-02T16:39:04Z
Distributions Debian:0.1.2.2, LTSHaskell:0.1.2.5, NixOS:0.1.2.5, Stackage:0.1.2.5
Downloads 8765 total (94 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for assert-failure-0.1.1.0

[back to package description]

assert-failure Build StatusBuild Status

This library contains syntactic sugar that improves the usability of 'assert' and 'error'. This is actually a bunch of hacks wrapping the original 'assert' function, which is, as of GHC 7.8, the only simple way of obtaining source positions. The original 'assert' function is here re-exported for convenience.

See also http://hackage.haskell.org/package/loch, http://hackage.haskell.org/package/assert and https://ghc.haskell.org/trac/ghc/ticket/5273.

Make sure to enable assertions for your cabal package, e.g., by setting

ghc-options: -fno-ignore-asserts

in your .cabal file. Otherwise, some of the functions will have no effect at all.

The library is available from [Hackage] 1 and it's homepage and issue tracker is on [github] 2. The library emerged from the tons of assertions (augmented by comments and printouts) and 'error' calls (marked by unique strings to overcome their lack of source position) in the [LambdaHack] 3 game engine.