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

[ bsd3, contract, control, library ] [ Propose Tags ] [ Report a vulnerability ]

This library contains syntactic sugar that makes it easier to write simple contracts with assert and error and report the values that violate contracts.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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, 0.1.2.6, 0.1.3.0
Dependencies base (>=4.6 && <99), pretty-show (>=1.6), text (>=0.11.2.3) [details]
Tested with ghc ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.3 || ==9.4 || ==9.6
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 2023-08-17T16:58:26Z
Distributions Arch:0.1.3.0, Debian:0.1.2.3, LTSHaskell:0.1.3.0, NixOS:0.1.3.0, Stackage:0.1.3.0
Reverse Dependencies 3 direct, 1 indirect [details]
Downloads 10319 total (26 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-08-17 [all 1 reports]

Readme for assert-failure-0.1.3.0

[back to package description]

assert-failure Hackage

This library contains syntactic sugar that makes it easier to write simple contracts with 'assert' and 'error' and report the values that violate contracts. The original 'assert' function is here re-exported for convenience.

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 emerged from the chaos of the tons of assertions (sometimes augmented by comments and trace printouts) and 'error' calls in the LambdaHack game engine.