
I've just been checking. The top level name *is* (and remains) an External Name. See below.
Don't be misled by the dump labelled "Typechecker" (-ddump-tc). It is carefully printing things as in error messages, with as little qualification as possible; since 'mysum' is in scope unqualified here, it's printed unqualified. But it's an External Name all right. Use -dppr-debug to see it in its full glory
Simon
==================== Renamer ====================
Foo.mysum :: [Int] -> Int
Foo.mysum xs = foldl' (+) 0 xs
TYPE SIGNATURES
mysum :: [Int] -> Int
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
==================== Typechecker ====================
AbsBinds
[]
[]
[mysum <= mysum
<>]
mysum :: [Int] -> Int
[LclId]
mysum xs = foldl' ((+)) 0 xs
==================== Desugar (after optimization) ====================
Result size = 11
Foo.mysum :: [GHC.Types.Int] -> GHC.Types.Int
[LclIdX]
Foo.mysum =
\ (xs_abz :: [GHC.Types.Int]) ->
Data.List.foldl'
@ GHC.Types.Int
@ GHC.Types.Int
(GHC.Num.+ @ GHC.Types.Int GHC.Num.$fNumInt)
(GHC.Types.I# 0)
xs_abz
| -----Original Message-----
| From: Johan Tibell [mailto:johan.tibell@gmail.com]
| Sent: 02 April 2013 17:43
| To: Simon Peyton-Jones
| Cc: ghc-devs@haskell.org
| Subject: Re: Why do Names defined in the current module lack a module
| name?
|
| Hi Simon,
|
| On Tue, Apr 2, 2013 at 3:31 AM, Simon Peyton-Jones
|