The assert-failure package

[maintain]

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]

Properties

Versions0.1, 0.1.1.0, 0.1.1.0
Dependenciesbase (==4.*), pretty-show (>=1.6 && <2), text (>=0.11.2.3 && <2) [details]
LicenseBSD3
AuthorMikolaj Konarski
MaintainerMikolaj Konarski <mikolaj.konarski@funktory.com>
CategoryControl, Contract
Home pagehttps://github.com/Mikolaj/assert-failure
Bug trackerhttps://github.com/Mikolaj/assert-failure/issues
Source repositoryhead: git clone git://github.com/Mikolaj/assert-failure.git
UploadedSun Mar 2 16:30:34 UTC 2014 by MikolajKonarski

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for assert-failure-0.1.1.0

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 and it's homepage and issue tracker is on github. 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 game engine.