Commit 10a07753 authored by niteria's avatar niteria Committed by Simon Marlow

Anchor type family instances deterministically

Summary:
This is very similar to D1073. It makes type family instances to be
attached to a binding with a least `OccName`, therefore not depending on `Unique` ordering.

Test Plan:
* this makes `Language.Haskell.Exts.SrcLoc` deterministic
* ./validate

Reviewers: simonmar, austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1192

GHC Trac Issues: #4012
parent 12098c2e
......@@ -1853,13 +1853,8 @@ famInstToIfaceFamInst (FamInst { fi_axiom = axiom,
orph | is_local fam_decl
= NotOrphan (nameOccName fam_decl)
| not (isEmptyNameSet lhs_names)
= NotOrphan (nameOccName (head (nameSetElems lhs_names)))
| otherwise
= IsOrphan
= chooseOrphanAnchor $ nameSetElems lhs_names
--------------------------
toIfaceLetBndr :: Id -> IfaceLetBndr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment