Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : cardinality
http://hackage.haskell.org/trac/ghc/changeset/47950ff4767de93020c3000435545f7793bca0fc >--------------------------------------------------------------- commit 47950ff4767de93020c3000435545f7793bca0fc Author: Ilya Sergey <[email protected]> Date: Tue Sep 25 20:27:06 2012 +0100 typos in the notes fixed >--------------------------------------------------------------- compiler/stranal/DmdAnal.lhs | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs index 8b295bd..24a2c3b 100644 --- a/compiler/stranal/DmdAnal.lhs +++ b/compiler/stranal/DmdAnal.lhs @@ -345,9 +345,10 @@ Note [Analysing lambdas at right-hand side] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is safe to analyze a lambda-expression on a right-hand-side of a -let-binding with a usage demand C1(C1...(U)), where the number of C1s +let-binding with a usage demand C1(C1...(U1)), where the number of C1s is the same as "visible" arity of the right-hand side. However, this -poses a problem when markin lambda s on-shot. Indeed, both these lambdas: +poses a problem when marking lambda s on-shot. Indeed, both these +lambdas: let g = \x -> x + 1 in ... @@ -357,13 +358,13 @@ and will be marked as "one-shot", whereas only the latter one is. A let-bound lambda can be, of course, invoked multiple times, and we -cannot state it to be on-shot just lookting at the definition +cannot state it to be on-shot just looking at the definition site. Therefore, we pass an extra flag to the analysis: data RhsFlag = MayBeRhsLambda | MereExpr -in order to ditinguish, if the currently analyzed expression is a -(possibly nested) lambda, located *immediately* at RHS of som binding +in order to distinguish, if the currently analyzed expression is a +(possibly nested) lambda, located *immediately* at RHS of some binding (then the one-shot annotation is not assigned) or just an arbitrary lambda expression somewhere, e.g. _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
