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,249
Issues
4,249
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
391
Merge Requests
391
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
92b684de
Commit
92b684de
authored
Jan 11, 2019
by
Richard Eisenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More minor comment improvements
[skip ci]
parent
c2455e64
Pipeline
#1049
failed with stages
in 241 minutes and 12 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
compiler/types/CoAxiom.hs
compiler/types/CoAxiom.hs
+4
-10
compiler/types/Type.hs
compiler/types/Type.hs
+4
-2
No files found.
compiler/types/CoAxiom.hs
View file @
92b684de
...
...
@@ -319,20 +319,14 @@ Note [CoAxBranch type variables]
In the case of a CoAxBranch of an associated type-family instance,
we use the *same* type variables (where possible) as the
enclosing class or instance. Consider
class C a b where
type F x b
type F [y] b = ... -- Second param must be b
instance C Int [z] where
instance C Int [z] where
type F Int [z] = ... -- Second param must be [z]
In the CoAxBranch in the instance decl (F Int [z]) we use the
same 'z', so that it's easy to check that that type is the same
as that in the instance header.
Similarly in the CoAxBranch for the default decl for F in the
class decl, we use the same 'b' to make the same check easy.
So, unlike FamInsts, there is no expectation that the cab_tvs
are fresh wrt each other, or any other CoAxBranch.
...
...
@@ -412,13 +406,13 @@ Now
For a CoAxBranch for a data family instance with representation
TyCon rep_tc:
- cab_tvs of its CoAxiom) may be shorter
- cab_tvs
(
of its CoAxiom) may be shorter
than tyConTyVars of rep_tc.
- cab_lhs may be shorter than tyConArity of the family tycon
i.e. LHS is unsaturated
- cab_rhs will be (rep_tc cab_
_
tvs)
- cab_rhs will be (rep_tc cab_tvs)
i.e. RHS is un-saturated
- This eta reduction happens for data instances as well
...
...
@@ -431,7 +425,7 @@ But for a /type/ family
There are certain situations (e.g., pretty-printing) where it is necessary to
deal with eta-expanded data family instances. For these situations, the
cab_eta_tvs field records the stuff that has been eta-
expand
ed away.
cab_eta_tvs field records the stuff that has been eta-
reduc
ed away.
So if we have
axiom forall a b. F [a->b] = D b a
and cab_eta_tvs is [p,q], then the original user-written definition
...
...
compiler/types/Type.hs
View file @
92b684de
...
...
@@ -1389,14 +1389,16 @@ mkLamType v ty
mkLamTypes
vs
ty
=
foldr
mkLamType
ty
vs
-- | Given a list of type-level vars and a result kind,
-- | Given a list of type-level vars and
the free vars of
a result kind,
-- makes TyCoBinders, preferring anonymous binders
-- if the variable is, in fact, not dependent.
-- e.g. mkTyConBindersPreferAnon [(k:*),(b:k),(c:k)] (k->k)
-- We want (k:*) Named, (b:k) Anon, (c:k) Anon
--
-- All non-coercion binders are /visible/.
mkTyConBindersPreferAnon
::
[
TyVar
]
->
TyCoVarSet
->
[
TyConBinder
]
mkTyConBindersPreferAnon
::
[
TyVar
]
-- ^ binders
->
TyCoVarSet
-- ^ free variables of result
->
[
TyConBinder
]
mkTyConBindersPreferAnon
vars
inner_tkvs
=
ASSERT
(
all
isTyVar
vars
)
fst
(
go
vars
)
where
...
...
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