I'm supportive of doing this, and am working with Edward on it. Yell if you object. Simon | -----Original Message----- | From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of | Edward Z. Yang | Sent: 11 August 2016 20:07 | To: ghc-devs <ghc-devs@haskell.org> | Subject: Landing Backpack in HEAD | | Hello friends, | | I'm hoping to land Backpack (the patch is two years in the making | now!) for GHC 8.2, even though 8.2 is intended to be a stabilization | and performance release. In this email, I will make the case that the | Backpack patch is relatively self-contained and will not affect non- | Backpack users, and explain how you might be affected by the patch. | The most recent patchset can be found at | https://github.com/ezyang/ghc/tree/ghc-backpack ; look for "The | Backpack patch" in the commit log, since I plan on squashing these | commits before committing. | | OK, here is what is in the patchset that affects non-Backpack users: | | - The primary, overarching change is that there is now | a distinction between "semantic" and "identity" modules. | This solves a problem with hsig files: suppose | you have A.hsig which defines data T in package p. | The resulting A.hi is most accurately identified | as p[A=<A>]:A; however, the Name for T should be <A>.T, | not p[A=<A>]:A.T. The former is an identity module | (it *identifies* interfaces), whereas the latter is a semantic | module (it is what is used in names). Without Backpack, | these two identities are always the same. There are a number | of places in the existing codepaths where we have to | distinguish between the two concepts (sometimes you | want semantic, sometimes you want identity); we DEFAULT | to the identity module but I fix a few cases where | semantic modules were desired instead. | | - UnitId is generalized to also record how a component | is instantiated (a mapping from module names to modules.) | Without Backpack this is blank and equivalent to the | existing UnitId. | | - Packages has been refactored to also handle Backpack `-unit-id` | flags, since we have to do some extra work to determine | what inherited signatures merge where. | | - The patch REVERTS all of the old support we had for hsig | files; -sig-of is no more. spinda had mentioned that | Liquid Haskell used this in some cases, and I'm looking | at supporting *just* their particular use-case. | | - A new driver mode --backpack, which process test.bkp files. | This mode is used PURELY for testing, and end users | are not supposed to use it. These all live in their own | modules (BkpSyn, DriverBkp) except for some modest, | convenient extensions to the lexer and parser to parse | multiple modules at once. | | The patch also comes with rewritten typechecking support for hsig | files, and instantiating indefinite packages on the fly, but these are | all standalone pieces of functionality which are not tied to any | existing compiler infrastructure. | | Thanks, | Edward | _______________________________________________ | ghc-devs mailing list | ghc-devs@haskell.org | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h | askell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc- | devs&data=02%7c01%7csimonpj%40microsoft.com%7c53ecc3a967e94989c6ea08d3 | c21aba4a%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c6360653924505858 | 34&sdata=M9gGg0DYYyLgiETs8bYGuxLlU7uVDJweyo5NeJB2bDM%3d