diff options
author | Jose Pedro Magalhaes <jpm@cs.ox.ac.uk> | 2014-11-04 11:10:27 +0000 |
---|---|---|
committer | Jose Pedro Magalhaes <jpm@cs.ox.ac.uk> | 2014-11-04 11:10:27 +0000 |
commit | 3744afb5d91ebbe235230b7e9a03e1918ed4aa2c (patch) | |
tree | ae953eebc9230a176721b49c64f8a63102b627f6 /compiler/simplCore | |
parent | d8e899686d7f3092af54932f46ab122dc8d3d373 (diff) | |
parent | d3a7126ff749d1eff31128ace31bcea26c4eadaa (diff) | |
download | haskell-wip/GenericsMetaData.tar.gz |
Merge branch 'master' into wip/GenericsMetaDatawip/GenericsMetaData
Diffstat (limited to 'compiler/simplCore')
-rw-r--r-- | compiler/simplCore/CallArity.hs | 4 | ||||
-rw-r--r-- | compiler/simplCore/SetLevels.lhs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/simplCore/CallArity.hs b/compiler/simplCore/CallArity.hs index bead230bcd..5ee5fe296a 100644 --- a/compiler/simplCore/CallArity.hs +++ b/compiler/simplCore/CallArity.hs @@ -33,7 +33,7 @@ Note [Call Arity: The goal] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ The goal of this analysis is to find out if we can eta-expand a local function, -based on how it is being called. The motivating example is code this this, +based on how it is being called. The motivating example is this code, which comes up when we implement foldl using foldr, and do list fusion: let go = \x -> let d = case ... of @@ -46,7 +46,7 @@ If we do not eta-expand `go` to have arity 2, we are going to allocate a lot of partial function applications, which would be bad. The function `go` has a type of arity two, but only one lambda is manifest. -Further more, an analysis that only looks at the RHS of go cannot be sufficient +Furthermore, an analysis that only looks at the RHS of go cannot be sufficient to eta-expand go: If `go` is ever called with one argument (and the result used multiple times), we would be doing the work in `...` multiple times. diff --git a/compiler/simplCore/SetLevels.lhs b/compiler/simplCore/SetLevels.lhs index 645cf9fc14..b8726d93a4 100644 --- a/compiler/simplCore/SetLevels.lhs +++ b/compiler/simplCore/SetLevels.lhs @@ -331,7 +331,7 @@ lvlExpr env expr@(_, AnnApp _ _) = do -- We don't split adjacent lambdas. That is, given -- \x y -> (x+1,y) -- we don't float to give --- \x -> let v = x+y in \y -> (v,y) +-- \x -> let v = x+1 in \y -> (v,y) -- Why not? Because partial applications are fairly rare, and splitting -- lambdas makes them more expensive. |