Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
f21f0517
Commit
f21f0517
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-02-03 22:47:48 by sof]
Added entry for assertions
parent
82c39e15
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/docs/users_guide/3-01-notes.vsgml
+30
-0
30 additions, 0 deletions
ghc/docs/users_guide/3-01-notes.vsgml
with
30 additions
and
0 deletions
ghc/docs/users_guide/3-01-notes.vsgml
+
30
−
0
View file @
f21f0517
...
...
@@ -16,4 +16,34 @@ Changes made since 3.00:
<item> imported HBC's quick-sort algorithm from @QSort@ into @List@.
<item> added support for assertions. Conceptually, a new function has
been added to the Prelude with the following type:
<tscreen> <verb>
assert :: Bool -> a -> a
</verb> </tscreen>
which has the following behaviour:
<tscreen> <verb>
assert pred v
| pred = v
| otherwise = error "assertion failed"
</verb> </tscreen>
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 <tt/assert/
to instead invoke the function <tt/assert__/ :
<tscreen> <verb>
assert__ :: String -> Bool -> a -> a
</verb> </tscreen>
where the first argument to <tt/assert__/ is a compiler generated string
which encodes the source location of the original <tt/assert/.
Assertions are a Glasgow extension, so -fglasgow-exts is
needed to use them.
</itemize>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment