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,262
Issues
4,262
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
404
Merge Requests
404
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
290ec750
Commit
290ec750
authored
Aug 02, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a comment to explain why the FCode monad is lazy
parent
5620662e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
compiler/codeGen/StgCmmBind.hs
compiler/codeGen/StgCmmBind.hs
+2
-1
compiler/codeGen/StgCmmMonad.hs
compiler/codeGen/StgCmmMonad.hs
+7
-0
No files found.
compiler/codeGen/StgCmmBind.hs
View file @
290ec750
...
...
@@ -113,7 +113,8 @@ cgBind (StgRec pairs)
;
addBindsC
new_binds
;
emit
(
catAGraphs
inits
<*>
body
)
}
{- Recursive let-bindings are tricky.
{- Note [cgBind rec]
Recursive let-bindings are tricky.
Consider the following pseudocode:
let x = \_ -> ... y ...
y = \_ -> ... z ...
...
...
compiler/codeGen/StgCmmMonad.hs
View file @
290ec750
...
...
@@ -143,6 +143,13 @@ thenFC (FCode m) k = FCode (
in
kcode
info_down
new_state
)
-- Note: this is a lazy monad. We can't easily make it strict due
-- to the use of fixC for compiling recursive bindings (see Note
-- [cgBind rec]). cgRhs returns a CgIdInfo which is fed back in
-- via the CgBindings, and making the monad strict means that we
-- can't look at the CgIdInfo too early. Things seem to just
-- about work when the monad is lazy. I hate this stuff --SDM
listFCs
::
[
FCode
a
]
->
FCode
[
a
]
listFCs
=
Prelude
.
sequence
...
...
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