Skip to content

Report the provenance of TyThings

One thing we are slightly nervous about regarding our resolution to #14396 (closed) 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.

Trac metadata
Trac field Value
Version 8.2.1
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information