summaryrefslogtreecommitdiff
path: root/compiler/stranal/DmdAnal.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-08-03 11:04:22 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-08-03 11:07:41 +0100
commit4d8859cc6302b89c81de9b6e4af241527c8fe716 (patch)
tree65a2d5f3fc567bc6a022231ad5ee0e7737e142b1 /compiler/stranal/DmdAnal.hs
parentb38ee89c8c8724ba2feb98d4082795a5d4ae96f6 (diff)
downloadhaskell-4d8859cc6302b89c81de9b6e4af241527c8fe716.tar.gz
Typos in comments
Diffstat (limited to 'compiler/stranal/DmdAnal.hs')
-rw-r--r--compiler/stranal/DmdAnal.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs
index 8b97b6be98..5836bfd6af 100644
--- a/compiler/stranal/DmdAnal.hs
+++ b/compiler/stranal/DmdAnal.hs
@@ -342,7 +342,7 @@ dmdAnalAlt env dmd case_bndr (con,bndrs,rhs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There's a hack here for I/O operations. Consider
case foo x s of { (# s, r #) -> y }
-Is this strict in 'y'. Normally yes, but what if 'foo' is an I/O
+Is this strict in 'y'? Normally yes, but what if 'foo' is an I/O
operation that simply terminates the program (not in an erroneous way)?
In that case we should not evaluate 'y' before the call to 'foo'.
Hackish solution: spot the IO-like situation and add a virtual branch,
@@ -365,14 +365,14 @@ However, consider
Here it is terribly sad to make 'f' lazy in 's'. After all,
getMaskingState# is not going to diverge or throw an exception! This
situation actually arises in GHC.IO.Handle.Internals.wantReadableHandle
-(on an MVar not an Int), and make a material difference.
+(on an MVar not an Int), and made a material difference.
So if the scrutinee is a primop call, we *don't* apply the
state hack:
- If is a simple, terminating one like getMaskingState,
applying the hack is over-conservative.
- If the primop is raise# then it returns bottom, so
- the case alternatives are alraedy discarded.
+ the case alternatives are already discarded.
- If the primop can raise a non-IO exception, like
divide by zero or seg-fault (eg writing an array
out of bounds) then we don't mind evaluating 'x' first.