From: sof Date: Tue, 3 Feb 1998 22:47:48 +0000 (+0000) Subject: [project @ 1998-02-03 22:47:48 by sof] X-Git-Tag: Approx_2487_patches~1000 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f21f0517e9281df7ad7d4c73ec43839bfcf4d932;p=ghc-hetmet.git [project @ 1998-02-03 22:47:48 by sof] Added entry for assertions --- diff --git a/ghc/docs/users_guide/3-01-notes.vsgml b/ghc/docs/users_guide/3-01-notes.vsgml index ebb3bb2..c5fd50a 100644 --- a/ghc/docs/users_guide/3-01-notes.vsgml +++ b/ghc/docs/users_guide/3-01-notes.vsgml @@ -16,4 +16,34 @@ Changes made since 3.00: imported HBC's quick-sort algorithm from @QSort@ into @List@. + added support for assertions. Conceptually, a new function has + been added to the Prelude with the following type: + + + assert :: Bool -> a -> a + + + which has the following behaviour: + + + assert pred v + | pred = v + | otherwise = error "assertion failed" + + + However in this form, the practical use of assertions is + limited as no indication is given as to what assertion failed. + So to help out here, ghc will rewrite any uses of + assert__ :: String -> Bool -> a -> a + + + where the first argument to