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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
alexbiehl-gc
GHC
Commits
98eb01d1
Commit
98eb01d1
authored
25 years ago
by
Simon Peyton Jones
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-11-01 16:06:34 by simonpj]
Minor tweaks to intro, and description of RULES
parent
cfd47515
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/docs/users_guide/glasgow_exts.vsgml
+10
-4
10 additions, 4 deletions
ghc/docs/users_guide/glasgow_exts.vsgml
ghc/docs/users_guide/intro.vsgml
+6
-3
6 additions, 3 deletions
ghc/docs/users_guide/intro.vsgml
with
16 additions
and
7 deletions
ghc/docs/users_guide/glasgow_exts.vsgml
+
10
−
4
View file @
98eb01d1
%
% $Id: glasgow_exts.vsgml,v 1.1
7
1999/1
0/28 07:53:13
simonpj Exp $
% $Id: glasgow_exts.vsgml,v 1.1
8
1999/1
1/01 16:06:34
simonpj Exp $
%
% GHC Language Extensions.
%
...
...
@@ -2085,9 +2085,14 @@ This rule will cause the compiler to go into an infinite loop.
<item> GHC currently uses a very simple, syntactic, matching algorithm
for matching a rule LHS with an expression. It seeks a substitution
which makes the LHS and expression syntactically equal modulo: alpha
conversion, and (I think) eta conversion. But not beta conversion (that's
called higher-order matching).
which makes the LHS and expression syntactically equal modulo alpha
conversion. The pattern (rule), but not the expression, is eta-expanded if
necessary. (Eta-expanding the epression can lead to laziness bugs.)
But not beta conversion (that's called higher-order matching).
<p>
Matching is carried out on GHC's intermediate language, which includes
type abstractions and applications. So a rule only matches if the
types match too. See Section <ref name="Specialisation" id="rule-spec"> below.
<item> GHC keeps trying to apply the rules as it optimises the program.
For example, consider:
...
...
@@ -2184,6 +2189,7 @@ If you want to write your own good consumers or producers, look at the
Prelude definitions of the above functions to see how to do so.
<sect2>Specialisation
<label id="rule-spec">
<p>
Rewrite rules can be used to get the same effect as a feature
...
...
This diff is collapsed.
Click to expand it.
ghc/docs/users_guide/intro.vsgml
+
6
−
3
View file @
98eb01d1
...
...
@@ -3,8 +3,12 @@
<p>
This is a guide to using the Glasgow Haskell compilation (GHC) system.
It is a batch compiler for the Haskell~
1.4
language, with support for
It is a batch compiler for the Haskell~
98
language, with support for
various Glasgow-only extensions.
In this document, we assume that GHC has been installed at your site
as @ghc@. A separate document, ``Building and Installing the
Glasgow Functional Programming Tools Suite'',
describes how to install @ghc@.
Many people will use GHC very simply: compile some
modules---@ghc -c -O Foo.hs Bar.hs@; and link them---
...
...
@@ -17,8 +21,7 @@ ghc -c -O -fno-foldr-build -dcore-lint -fvia-C -ddump-simpl Foo.lhs
</verb></tscreen>
Stay tuned---all will be revealed!
In this document, we assume that GHC has been installed at your site
as @ghc@. The rest of this section provide some tutorial information
The rest of this section provide some tutorial information
on batch-style compilation; if you're familiar with these concepts
already, then feel free to skip to the next section.
...
...
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