[GHC] #10723: Make declarations in signatures "weakly bound" until they are used

GHC ghc-devs at haskell.org
Mon Aug 3 18:31:03 UTC 2015


#10723: Make declarations in signatures "weakly bound" until they are used
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:  ezyang
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Package system    |                 Version:  7.11
      Resolution:                    |                Keywords:  backpack
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by ezyang):

 It is hard to say what will actually happen in practice until we have
 people actually using backpack, but I suspect that thinning only at the
 module level won't be enough. There are two reasons:

 1. Think about the average Haskell module: it contains a lot of functions!
 This means that the normal signature someone will write for a module that
 already exists is going to have a lot of functions. Here, thinning at the
 expression level seems more important.

 2. How are people going to write signatures? I think that for library
 level signatures, the best use of peoples time is for signatures to
 automatically be inferred from existing implementations rather than
 forcing people to write signatures all the time. So a signature will in
 general contain way too much stuff! Thinning definitely is necessary in
 this case.

 The benefit of implicit thinning is that, although it is strange from a
 language design perspective, it makes a lot of sense intuitively: there is
 no dependence on the import graph: a units requirements are completely
 specified as the set of requirements that it uses, and the set of
 requirements it available to includers. Yes, it is not syntactically
 evident what this is, but the whole point of a compiler is that you can
 get it to tell you what it is (eg some sort of Haddock documentation.
 Where as with thinning, sometimes it is not permissible to thin a
 requirement depending on whether it was imported by a module.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10723#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list