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
Tobias Decking
GHC
Commits
f761d6d0
Commit
f761d6d0
authored
Feb 19, 2003
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2003-02-19 13:05:45 by simonpj]
Wibbles to the new datacon story; fixes ds002
parent
d7a583e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
ghc/compiler/deSugar/Desugar.lhs
ghc/compiler/deSugar/Desugar.lhs
+2
-2
ghc/compiler/deSugar/DsGRHSs.lhs
ghc/compiler/deSugar/DsGRHSs.lhs
+6
-2
ghc/compiler/deSugar/DsListComp.lhs
ghc/compiler/deSugar/DsListComp.lhs
+7
-9
No files found.
ghc/compiler/deSugar/Desugar.lhs
View file @
f761d6d0
...
...
@@ -129,10 +129,10 @@ deSugar hsc_env pcs
hpt = hsc_HPT hsc_env
lookup n = case lookupType hpt pte n of {
Just v -> v ;
other ->
other
->
case lookupNameEnv type_env n of
Just v -> v ;
other
-> pprPanic "Desugar: lookup:" (ppr n)
other -> pprPanic "Desugar: lookup:" (ppr n)
}
deSugarExpr :: HscEnv
...
...
ghc/compiler/deSugar/DsGRHSs.lhs
View file @
f761d6d0
...
...
@@ -18,8 +18,10 @@ import Type ( Type )
import DsMonad
import DsUtils
import Unique ( Uniquable(..) )
import PrelInfo ( nON_EXHAUSTIVE_GUARDS_ERROR_ID )
import PrelNames ( otherwiseIdKey, trueDataConKey, hasKey )
import TysWiredIn ( trueDataConId )
import PrelNames ( otherwiseIdKey, hasKey )
\end{code}
@dsGuarded@ is used for both @case@ expressions and pattern bindings.
...
...
@@ -85,7 +87,9 @@ matchGuard [ResultStmt expr locn] ctx
-- Turn an "otherwise" guard is a no-op
matchGuard (ExprStmt (HsVar v) _ _ : stmts) ctx
| v `hasKey` otherwiseIdKey
|| v `hasKey` trueDataConKey
|| v `hasKey` getUnique trueDataConId
-- trueDataConId doesn't have the same
-- unique as trueDataCon
= matchGuard stmts ctx
matchGuard (ExprStmt expr _ locn : stmts) ctx
...
...
ghc/compiler/deSugar/DsListComp.lhs
View file @
f761d6d0
...
...
@@ -29,12 +29,12 @@ import Var ( Id )
import Type ( mkTyVarTy, mkFunTys, mkFunTy, Type,
splitTyConApp_maybe )
import TysPrim ( alphaTyVar )
import TysWiredIn ( nilDataCon, consDataCon, unitDataConId, unitTy,
import TysWiredIn ( nilDataCon, consDataCon, trueDataConId, falseDataConId,
unitDataConId, unitTy,
mkListTy, mkTupleTy )
import Match ( matchSimply )
import PrelNames ( trueDataConName, falseDataConName, foldrName,
buildName, replicatePName, mapPName, filterPName,
zipPName, crossPName, parrTyConName )
import PrelNames ( foldrName, buildName, replicatePName, mapPName,
filterPName, zipPName, crossPName, parrTyConName )
import PrelInfo ( pAT_ERROR_ID )
import SrcLoc ( noSrcLoc )
import Panic ( panic )
...
...
@@ -384,15 +384,13 @@ dePArrComp (ExprStmt b _ _ : qs) pa cea =
-- <<[:e' | qs:]>> (pa, p) (crossP ea ef)
--
dePArrComp (BindStmt p e _ : qs) pa cea =
dsLookupGlobalId falseDataConName `thenDs` \falseId ->
dsLookupGlobalId trueDataConName `thenDs` \trueId ->
dsLookupGlobalId filterPName `thenDs` \filterP ->
dsLookupGlobalId crossPName `thenDs` \crossP ->
dsExpr e
`thenDs` \ce ->
dsExpr e `thenDs` \ce ->
let ty'cea = parrElemType cea
ty'ce = parrElemType ce
false = Var falseId
true = Var trueId
false = Var false
DataCon
Id
true = Var true
DataCon
Id
in
newSysLocalDs ty'ce `thenDs` \v ->
matchSimply (Var v) (StmtCtxt PArrComp) p true false `thenDs` \pred ->
...
...
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