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,273
Issues
4,273
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
413
Merge Requests
413
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
1a1164f5
Commit
1a1164f5
authored
Feb 21, 2007
by
mnislaih
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an incomplete pattern in the code for :print
parent
704422eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
compiler/ghci/Debugger.hs
compiler/ghci/Debugger.hs
+16
-15
No files found.
compiler/ghci/Debugger.hs
View file @
1a1164f5
...
...
@@ -66,8 +66,8 @@ pprintClosureCommand bindThings force str = do
uniques
<-
liftM
uniqsFromSupply
(
mkSplitUniqSupply
'q'
)
return
$
map
(
\
u
->
(
mkSysTvName
u
(
mkFastString
"a"
)))
uniques
mb_ids
<-
io
$
mapM
(
cleanUp
cms
newvarsNames
)
(
words
str
)
new_ids
<-
mapM
(
io
.
go
cms
)
(
catMaybes
mb_ids
)
io
$
updateIds
cms
new_ids
mb_
new_ids
<-
mapM
(
io
.
go
cms
)
(
catMaybes
mb_ids
)
io
$
updateIds
cms
(
catMaybes
mb_new_ids
)
where
-- Find the Id, clean up 'Unknowns'
cleanUp
::
Session
->
[
Name
]
->
String
->
IO
(
Maybe
Id
)
...
...
@@ -78,22 +78,23 @@ pprintClosureCommand bindThings force str = do
-- Do the obtainTerm--bindSuspensions-refineIdType dance
-- Warning! This function got a good deal of side-effects
go
::
Session
->
Id
->
IO
Id
go
::
Session
->
Id
->
IO
(
Maybe
Id
)
go
cms
id
=
do
Just
term
<-
obtainTerm
cms
force
id
term'
<-
if
not
bindThings
then
return
term
else
bindSuspensions
cms
term
showterm
<-
pprTerm
cms
term'
unqual
<-
GHC
.
getPrintUnqual
cms
let
showSDocForUserOneLine
unqual
doc
=
showDocWith
LeftMode
(
doc
(
mkErrStyle
unqual
))
(
putStrLn
.
showSDocForUserOneLine
unqual
)
(
ppr
id
<+>
char
'='
<+>
showterm
)
mb_term
<-
obtainTerm
cms
force
id
maybe
(
return
Nothing
)
`
flip
`
mb_term
$
\
term
->
do
term'
<-
if
not
bindThings
then
return
term
else
bindSuspensions
cms
term
showterm
<-
pprTerm
cms
term'
unqual
<-
GHC
.
getPrintUnqual
cms
let
showSDocForUserOneLine
unqual
doc
=
showDocWith
LeftMode
(
doc
(
mkErrStyle
unqual
))
(
putStrLn
.
showSDocForUserOneLine
unqual
)
(
ppr
id
<+>
char
'='
<+>
showterm
)
-- Before leaving, we compare the type obtained to see if it's more specific
-- Note how we need the Unknown-clear type returned by obtainTerm
let
Just
reconstructedType
=
termType
term
new_type
<-
instantiateTyVarsToUnknown
cms
(
mostSpecificType
(
idType
id
)
reconstructedType
)
return
(
setIdType
id
new_type
)
let
Just
reconstructedType
=
termType
term
new_type
<-
instantiateTyVarsToUnknown
cms
(
mostSpecificType
(
idType
id
)
reconstructedType
)
return
.
Just
$
setIdType
id
new_type
updateIds
::
Session
->
[
Id
]
->
IO
()
updateIds
(
Session
ref
)
new_ids
=
do
...
...
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