• Sylvain Henry's avatar
    Add HomeUnit type · ffc0d578
    Sylvain Henry authored
    Since Backpack the "home unit" is much more involved than what it was
    before (just an identifier obtained with `-this-unit-id`). Now it is
    used in conjunction with `-component-id` and `-instantiated-with` to
    configure module instantiations and to detect if we are type-checking an
    indefinite unit or compiling a definite one.
    
    This patch introduces a new HomeUnit datatype which is much easier to
    understand. Moreover to make GHC support several packages in the same
    instances, we will need to handle several HomeUnits so having a
    dedicated (documented) type is helpful.
    
    Finally in #14335 we will also need to handle the case where we have no
    HomeUnit at all because we are only loading existing interfaces for
    plugins which live in a different space compared to units used to
    produce target code. Several functions will have to be refactored to
    accept "Maybe HomeUnit" parameters instead of implicitly querying the
    HomeUnit fields in DynFlags. Having a dedicated type will make this
    easier.
    
    Bump haddock submodule
    ffc0d578
Code owners : Ben Gamari
Load.hs 57.3 KB