[GHC] #14550: Report the provenance of TyThings

#14550: Report the provenance of TyThings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- One thing we are slightly nervous about regarding our resolution to #14396 is whether or not there will be a difficult to understand bug stemming from the fact that we may silently pick up an hs-boot TyThing, depending on when you do a lookup. You may be able to find the information by printing the TyThing with pprTyThing, but nothing is going to tell you, in the face, "Hey! This came from a boot file!" So, simonpj suggested that we extend the TyThing pretty-printer to say where a TyThing came from. This is a good question. The big question: where will we put the provenance? There are two possibilities: 1. Add a field in each constructor TyThing recording the provenance (this feels like a disruptive to an otherwise very simple union) 2. Add a field to each of the constructors Id, ConLike, TyCon, CoAxiom (this involves a lot more typing, but these constructors already have lots of fields so it's not as disruptive) The provenance will, for now, look something like: {{{ newtype TyThingSrc = TyThingSrc { tyThingFromBoot :: Bool } }}} and then `TcIface` will be extended to know if we're in boot and will fill things in accordingly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14550 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14550: Report the provenance of TyThings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): For `TyCon` at least we already have this: the `AlgTyConRhs` is an `AbstractTyCon`. For type functions we have `FamTyConFlav` = `AbstractClosedSynFamilyTyCon`. Etc. I think this is probably the way to go. For `Id` we have `IdDetails`, which could perhaps add `AbstractVanillaId`. Etc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14550#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC