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
4,251
Issues
4,251
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
396
Merge Requests
396
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
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
Glasgow Haskell Compiler
GHC
Commits
2c4c6271
Commit
2c4c6271
authored
Jun 02, 2015
by
Gabor Greif
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typofixes
parent
7a82b776
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
compiler/hsSyn/HsBinds.hs
compiler/hsSyn/HsBinds.hs
+1
-1
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcBinds.hs
+6
-6
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcInstDcls.hs
+1
-1
compiler/typecheck/TcPat.hs
compiler/typecheck/TcPat.hs
+1
-1
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnDriver.hs
+2
-2
No files found.
compiler/hsSyn/HsBinds.hs
View file @
2c4c6271
...
...
@@ -333,7 +333,7 @@ This ultimately desugars to something like this:
(fm::a->a,gm:Any->Any) -> fm
...similarly for g...
The abe_wrap field deals with imped
e
nce-matching between
The abe_wrap field deals with imped
a
nce-matching between
(/\a b. case tup a b of { (f,g) -> f })
and the thing we really want, which may have fewer type
variables. The action happens in TcBinds.mkExport.
...
...
compiler/typecheck/TcBinds.hs
View file @
2c4c6271
...
...
@@ -651,7 +651,7 @@ mkExport prag_fn qtvs inferred_theta (poly_name, mb_sig, mono_id)
;
traceTc
"mkExport: check sig"
(
vcat
[
ppr
poly_name
,
ppr
sel_poly_ty
,
ppr
(
idType
poly_id
)
])
-- Perform the imped
e
nce-matching and ambiguity check
-- Perform the imped
a
nce-matching and ambiguity check
-- right away. If it fails, we want to fail now (and recover
-- in tcPolyBinds). If we delay checking, we get an error cascade.
-- Remember we are in the tcPolyInfer case, so the type envt is
...
...
@@ -786,9 +786,9 @@ Examples that might fail:
- an inferred type that includes unboxed tuples
However we don't do the ambiguity check (checkValidType omits it for
InfSigCtxt) because the imped
e
nce-matching stage, which follows
InfSigCtxt) because the imped
a
nce-matching stage, which follows
immediately, will do it and we don't want two error messages.
Moreover, because of the imped
e
nce matching stage, the ambiguity-check
Moreover, because of the imped
a
nce matching stage, the ambiguity-check
suggestion of -XAllowAmbiguiousTypes will not work.
...
...
@@ -812,7 +812,7 @@ The types we really want for f and g are
f :: forall a. (Eq a, Num a) => a -> Bool -> Bool
g :: forall b. [b] -> Bool -> Bool
We can get these by "imped
e
nce matching":
We can get these by "imped
a
nce matching":
tuple :: forall a b. (Eq a, Num a) => (a -> Bool -> Bool, [b] -> Bool -> Bool)
tuple a b d1 d1 = let ...bind f_mono, g_mono in (f_mono, g_mono)
...
...
@@ -822,9 +822,9 @@ We can get these by "impedence matching":
Suppose the shared quantified tyvars are qtvs and constraints theta.
Then we want to check that
f's polytype is more polymorphic than forall qtvs. theta => f_mono_ty
and the proof is the imped
e
nce matcher.
and the proof is the imped
a
nce matcher.
Notice that the imped
e
nce matcher may do defaulting. See Trac #7173.
Notice that the imped
a
nce matcher may do defaulting. See Trac #7173.
It also cleverly does an ambiguity check; for example, rejecting
f :: F a -> a
...
...
compiler/typecheck/TcInstDcls.hs
View file @
2c4c6271
...
...
@@ -1498,7 +1498,7 @@ that the type variables bound in the signature will scope over the body.
What about the check that the instance method signature is more
polymorphic than the instantiated class method type? We just do a
tcSubType call in mkMethIds, and use the HsWrapper thus generated in
the method AbsBind. It's very like the tcSubType imped
e
nce-matching
the method AbsBind. It's very like the tcSubType imped
a
nce-matching
call in mkExport. We have to pass the HsWrapper into
tcMethodBody.
-}
...
...
compiler/typecheck/TcPat.hs
View file @
2c4c6271
...
...
@@ -397,7 +397,7 @@ Two cases, dealt with by the LetPat case of tcPatBndr
we want to bind a cloned, local version of the variable, with the
type given by the pattern context, *not* by the signature (even if
there is one; see Trac #7268). The mkExport part of the
generalisation step will do the checking and imped
e
nce matching
generalisation step will do the checking and imped
a
nce matching
against the signature.
* If for some some reason we are not generalising (plan = NoGen), the
...
...
compiler/typecheck/TcRnDriver.hs
View file @
2c4c6271
...
...
@@ -734,7 +734,7 @@ checkHiBootIface' :: [ClsInst] -> TypeEnv -> [AvailInfo]
-- Variant which doesn't require a full TcGblEnv; you could get the
-- local components from another ModDetails.
--
-- We return a list of "imped
e
nce-matching" bindings for the dfuns
-- We return a list of "imped
a
nce-matching" bindings for the dfuns
-- defined in the hs-boot file, such as
-- $fxEqT = $fEqT
-- We need these because the module and hi-boot file might differ in
...
...
@@ -759,7 +759,7 @@ checkHiBootIface'
-- instances? We can't easily equate tycons...
-- Check instance declarations
-- and generate an imped
e
nce-matching binding
-- and generate an imped
a
nce-matching binding
;
mb_dfun_prs
<-
mapM
check_inst
boot_insts
;
failIfErrsM
...
...
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