Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
e24638cf
Commit
e24638cf
authored
Nov 26, 2010
by
simonpj@microsoft.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Acutally, wild-card variables *can* have occurrences
This patch removes the Lint test, and comments why
parent
491b818a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
compiler/coreSyn/CoreLint.lhs
compiler/coreSyn/CoreLint.lhs
+0
-4
compiler/simplCore/SimplEnv.lhs
compiler/simplCore/SimplEnv.lhs
+9
-2
No files found.
compiler/coreSyn/CoreLint.lhs
View file @
e24638cf
...
...
@@ -227,10 +227,6 @@ lintCoreExpr (Var var)
= do { checkL (not (var == oneTupleDataConId))
(ptext (sLit "Illegal one-tuple"))
; checkL (not (var `hasKey` wildCardKey))
(ptext (sLit "Occurence of a wild-card binder") <+> ppr var)
-- See Note [WildCard binders] in SimplEnv
; checkDeadIdOcc var
; var' <- lookupIdInScope var
; return (idType var') }
...
...
compiler/simplCore/SimplEnv.lhs
View file @
e24638cf
...
...
@@ -240,11 +240,18 @@ Note [WildCard binders]
The program to be simplified may have wild binders
case e of wild { p -> ... }
We want to *rename* them away, so that there are no
occurrences of 'wild' (with wildCardKey). The easy
occurrences of 'wild
-id
' (with wildCardKey). The easy
way to do that is to start of with a representative
Id in the in-scope set
There should be no *occurrences* of wild.
There can be be *occurrences* of wild-id. For example,
MkCore.mkCoreApp transforms
e (a /# b) --> case (a /# b) of wild { DEFAULT -> e wild }
This is ok provided 'wild' isn't free in 'e', and that's the delicate
thing. Generally, you want to run the simplifier to get rid of the
wild-ids before doing much else.
It's a very dark corner of GHC. Maybe it should be cleaned up.
\begin{code}
getMode :: SimplEnv -> SimplifierMode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment