diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-01-15 17:30:30 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-01-18 11:55:41 +0000 |
commit | ec8a188a927a4db2e709541765e5ef545eae284c (patch) | |
tree | cbde55cf4ee60e4265536aee730c7c41d668824e /compiler/typecheck/TcInstDcls.hs | |
parent | 6e0c0fd2e09c552bf38e22645347dbb2e7327e8e (diff) | |
download | haskell-ec8a188a927a4db2e709541765e5ef545eae284c.tar.gz |
Refactoring on IdInfo and system derived names
Some modest refactoring, triggered in part by Trac #11051
* Kill off PatSynId, ReflectionId in IdDetails
They were barely used, and only for pretty-printing
* Add helper function Id.mkExportedVanillaId, and use it
* Polish up OccName.isDerivedOccName, as a predicate for
definitions generated internally by GHC, which we
might not want to show to the user.
* Kill off unused OccName.mkDerivedTyConOcc
* Shorten the derived OccNames for newtype and data
instance axioms
* A bit of related refactoring around newFamInstAxiomName
Diffstat (limited to 'compiler/typecheck/TcInstDcls.hs')
-rw-r--r-- | compiler/typecheck/TcInstDcls.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index 47cd73b589..4f0456852d 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -623,8 +623,7 @@ tcTyFamInstDecl mb_clsinfo (L loc decl@(TyFamInstDecl { tfid_eqn = eqn })) ; checkValidCoAxBranch mb_clsinfo fam_tc co_ax_branch -- (3) construct coercion axiom - ; rep_tc_name <- newFamInstAxiomName loc (unLoc fam_lname) - [co_ax_branch] + ; rep_tc_name <- newFamInstAxiomName fam_lname [coAxBranchLHS co_ax_branch] ; let axiom = mkUnbranchedCoAxiom rep_tc_name fam_tc co_ax_branch ; newFamInst SynFamilyInst axiom } @@ -667,7 +666,7 @@ tcDataFamInstDecl mb_clsinfo -- Construct representation tycon ; rep_tc_name <- newFamInstTyConName fam_tc_name pats' - ; axiom_name <- newImplicitBinder rep_tc_name mkInstTyCoOcc + ; axiom_name <- newFamInstAxiomName fam_tc_name [pats'] ; let (eta_pats, etad_tvs) = eta_reduce pats' eta_tvs = filterOut (`elem` etad_tvs) tvs' full_tvs = eta_tvs ++ etad_tvs |