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
3a7ac4f6
Commit
3a7ac4f6
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-05-26 04:51:57 by sof]
Updated imports; common AbsBinds cases optimised
parent
7668f220
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/deSugar/DsBinds.lhs
+15
-3
15 additions, 3 deletions
ghc/compiler/deSugar/DsBinds.lhs
with
15 additions
and
3 deletions
ghc/compiler/deSugar/DsBinds.lhs
+
15
−
3
View file @
3a7ac4f6
...
...
@@ -34,12 +34,12 @@ import Id ( idType, SYN_IE(DictVar), GenId, SYN_IE(Id) )
import ListSetOps ( minusList, intersectLists )
import Name ( isExported )
import PprType ( GenType )
import
PprSty
le
( PprStyle(..) )
import
Outputab
le ( PprStyle(..) )
import Type ( mkTyVarTy, isDictTy, instantiateTy
)
import TyVar ( tyVarSetToList, GenTyVar{-instance Eq-} )
import TysPrim ( voidTy )
import Util ( isIn, panic
{-, pprTrace ToDo:rm-}
)
import Util ( isIn, panic
, assertPanic
)
\end{code}
%************************************************************************
...
...
@@ -106,10 +106,22 @@ dsMonoBinds is_rec (PatMonoBind pat grhss_and_binds locn)
dsGuarded grhss_and_binds `thenDs` \ body_expr ->
mkSelectorBinds pat body_expr
dsMonoBinds is_rec (AbsBinds [] [] exports binds) -- Common special case
-- Common special case: no type or dictionary abstraction
dsMonoBinds is_rec (AbsBinds [] [] exports binds)
= dsMonoBinds is_rec binds `thenDs` \ prs ->
returnDs (prs ++ [(global, Var local) | (_, global, local) <- exports])
-- Another common case: one exported variable
-- All non-recursive bindings come through this way
dsMonoBinds is_rec (AbsBinds all_tyvars dicts [(tyvars, global, local)] binds)
= ASSERT( all (`elem` tyvars) all_tyvars )
dsMonoBinds is_rec binds `thenDs` \ core_prs ->
let
core_binds | is_rec = [Rec core_prs]
| otherwise = [NonRec b e | (b,e) <- core_prs]
in
returnDs [(global, mkLam tyvars dicts $ mkCoLetsAny core_binds (Var local))]
dsMonoBinds is_rec (AbsBinds all_tyvars dicts exports binds)
= dsMonoBinds is_rec binds `thenDs` \ core_prs ->
let
...
...
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