summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2015-08-31 16:10:34 +0100
committerSimon Marlow <marlowsd@gmail.com>2015-08-31 16:10:34 +0100
commit10a07753ff4ac0c1285454567c926d580d0f0470 (patch)
treede626daf6d7ac7907997a43c31281c496b16164f
parent12098c2e70b2a432f4ed675ed72b53a396cb2842 (diff)
downloadhaskell-10a07753ff4ac0c1285454567c926d580d0f0470.tar.gz
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
-rw-r--r--compiler/iface/MkIface.hs7
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index 697972af27..f594181af4 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -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