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,265
Issues
4,265
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
419
Merge Requests
419
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
174d3a53
Commit
174d3a53
authored
Mar 30, 2016
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactor of TcMType.tauifyExpType
Mainly to make it clearer that tauifyExpType is a no-op on (Check ty)
parent
bdd90426
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
compiler/typecheck/TcMType.hs
compiler/typecheck/TcMType.hs
+8
-4
No files found.
compiler/typecheck/TcMType.hs
View file @
174d3a53
...
...
@@ -393,14 +393,18 @@ checkingExpType err et = pprPanic "checkingExpType" (text err $$ ppr et)
tauifyExpType
::
ExpType
->
TcM
ExpType
-- ^ Turn a (Infer hole) type into a (Check alpha),
-- where alpha is a fresh unificaiton variable
tauifyExpType
exp_ty
=
do
{
ty
<-
expTypeToType
exp_ty
;
return
(
Check
ty
)
}
tauifyExpType
(
Check
ty
)
=
return
(
Check
ty
)
-- No-op for (Check ty)
tauifyExpType
(
Infer
u
tc_lvl
ki
ref
)
=
do
{
ty
<-
inferTypeToType
u
tc_lvl
ki
ref
;
return
(
Check
ty
)
}
-- | Extracts the expected type if there is one, or generates a new
-- TauTv if there isn't.
expTypeToType
::
ExpType
->
TcM
TcType
expTypeToType
(
Check
ty
)
=
return
ty
expTypeToType
(
Infer
u
tc_lvl
ki
ref
)
expTypeToType
(
Check
ty
)
=
return
ty
expTypeToType
(
Infer
u
tc_lvl
ki
ref
)
=
inferTypeToType
u
tc_lvl
ki
ref
inferTypeToType
::
Unique
->
TcLevel
->
Kind
->
IORef
(
Maybe
TcType
)
->
TcM
Type
inferTypeToType
u
tc_lvl
ki
ref
=
do
{
uniq
<-
newUnique
;
tv_ref
<-
newMutVar
Flexi
;
let
details
=
MetaTv
{
mtv_info
=
TauTv
...
...
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