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
8c006b06
Commit
8c006b06
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-06-05 21:02:51 by sof]
updated to account for extra arg in dsBinds applications
parent
01bb2208
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/deSugar/Match.lhs
+13
-7
13 additions, 7 deletions
ghc/compiler/deSugar/Match.lhs
with
13 additions
and
7 deletions
ghc/compiler/deSugar/Match.lhs
+
13
−
7
View file @
8c006b06
...
...
@@ -9,10 +9,15 @@
module Match ( match, matchWrapper, matchSimply ) where
IMP_Ubiq()
IMPORT_DELOOPER(DsLoop) -- here for paranoia-checking reasons
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
IMPORT_DELOOPER(DsLoop) -- here for paranoia-checking reasons
-- and to break dsExpr/dsBinds-ish loop
#else
import {-# SOURCE #-} DsExpr ( dsExpr )
import {-# SOURCE #-} DsBinds ( dsBinds )
#endif
import CmdLineOpts ( opt_WarnIncompletePatterns )
import CmdLineOpts ( opt_WarnIncompletePatterns
, opt_WarnOverlappedPatterns
)
import HsSyn
import TcHsSyn ( SYN_IE(TypecheckedPat), SYN_IE(TypecheckedMatch),
SYN_IE(TypecheckedHsBinds), SYN_IE(TypecheckedHsExpr) )
...
...
@@ -168,8 +173,9 @@ match [] eqns_info shadows
-- If at this stage we find that at least one of the shadowing
-- equations is guaranteed not to fail, then warn of an overlapping pattern
complete_match (EqnInfo [] match_result@(MatchResult _ _ _ cxt)) is_shadowed
| is_shadowed = dsShadowWarn cxt `thenDs` \ _ ->
returnDs match_result
| opt_WarnOverlappedPatterns && is_shadowed =
dsShadowWarn cxt `thenDs` \ _ ->
returnDs match_result
| otherwise = returnDs match_result
...
...
@@ -613,8 +619,8 @@ matchWrapper kind [(PatMatch (WildPat ty) match)] error_string
matchWrapper kind [(GRHSMatch
(GRHSsAndBindsOut [OtherwiseGRHS expr _] binds _))] error_string
= dsBinds binds
`thenDs` \ core_binds ->
dsExpr expr `thenDs` \ core_expr ->
= dsBinds
Nothing
binds
`thenDs` \ core_binds ->
dsExpr expr
`thenDs` \ core_expr ->
returnDs ([], mkCoLetsAny core_binds core_expr)
----------------------------------------------------------------------------
...
...
@@ -712,7 +718,7 @@ flattenMatches kind (match : matches)
= flatten_match (pat:pats_so_far) match
flatten_match pats_so_far (GRHSMatch (GRHSsAndBindsOut grhss binds ty))
= dsBinds binds
`thenDs` \ core_binds ->
= dsBinds
Nothing
binds `thenDs` \ core_binds ->
dsGRHSs ty kind pats grhss `thenDs` \ match_result ->
returnDs (EqnInfo pats (mkCoLetsMatchResult core_binds match_result))
where
...
...
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