[commit: ghc] new-demand-to-merge: necessary comments added (195a1a3)

Ilya Sergey <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : new-demand-to-merge

http://hackage.haskell.org/trac/ghc/changeset/195a1a312abf01420b6956c9293a0d3a40bdfc88

>---------------------------------------------------------------

commit 195a1a312abf01420b6956c9293a0d3a40bdfc88
Author: Ilya Sergey <[email protected]>
Date:   Wed Nov 7 16:29:12 2012 +0100

    necessary comments added

>---------------------------------------------------------------

 compiler/stranal/WwLib.lhs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs
index f471410..5874251 100644
--- a/compiler/stranal/WwLib.lhs
+++ b/compiler/stranal/WwLib.lhs
@@ -194,11 +194,21 @@ mkWorkerArgs args all_one_shot res_ty
     | otherwise	
     = (args ++ [newArg], args ++ [realWorldPrimId])
     where
+      -- see Note [All One-Shot Arguments of a Worker]
       newArg = if all_one_shot 
                then setOneShotLambda voidArgId
                else voidArgId     
 \end{code}
 
+Note [All One-Shot Arguments of a Worker]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sometimes, derived joint-points are just lambda-lifted thunks, whose
+only argument is of the unit type and is never used. This might
+interfere with the absence analysis, basing on which results these
+never-used arguments are eliminated in the worker. The additional
+argument `all_one_shot` of `mkWorkerArgs` is to prevent this.
+
 
 %************************************************************************
 %*									*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.