summaryrefslogtreecommitdiff
path: root/compiler/iface/BuildTyCl.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-12-24 14:55:35 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-12-24 14:59:57 +0000
commit1af0d36be801a2039ba5c3c1546f06b6dad9b7a1 (patch)
tree0b6cdabfff8af5e12d08081771c19f358fe6e70a /compiler/iface/BuildTyCl.hs
parentfcc7498f9b36c7c47d4d7aea8c277fe7a5699f51 (diff)
downloadhaskell-1af0d36be801a2039ba5c3c1546f06b6dad9b7a1.tar.gz
Refactoring only
This moves code around to more sensible places. - Construction for CoAxiom is localised in FamInstEnv - orphNamesOfxx moves to CoreFVs - roughMatchTcs, instanceCantMatch moves to Unify - mkNewTypeCo moves from Coercion to FamInstEnv, and is renamed mkNewTypeCoAxiom, which makes more sense
Diffstat (limited to 'compiler/iface/BuildTyCl.hs')
-rw-r--r--compiler/iface/BuildTyCl.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs
index d370d3712f..876c9c008d 100644
--- a/compiler/iface/BuildTyCl.hs
+++ b/compiler/iface/BuildTyCl.hs
@@ -17,7 +17,7 @@ module BuildTyCl (
#include "HsVersions.h"
import IfaceEnv
-import FamInstEnv( FamInstEnvs )
+import FamInstEnv( FamInstEnvs, mkNewTypeCoAxiom )
import TysWiredIn( isCTupleTyConName )
import PrelNames( tyConRepModOcc )
import DataCon
@@ -31,7 +31,6 @@ import Class
import TyCon
import Type
import Id
-import Coercion
import TcType
import SrcLoc( noSrcSpan )
@@ -65,12 +64,12 @@ mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs
-- because the latter is part of a knot, whereas the former is not.
mkNewTyConRhs tycon_name tycon con
= do { co_tycon_name <- newImplicitBinder tycon_name mkNewTyCoOcc
- ; let co_tycon = mkNewTypeCo co_tycon_name tycon etad_tvs etad_roles etad_rhs
- ; traceIf (text "mkNewTyConRhs" <+> ppr co_tycon)
+ ; let nt_ax = mkNewTypeCoAxiom co_tycon_name tycon etad_tvs etad_roles etad_rhs
+ ; traceIf (text "mkNewTyConRhs" <+> ppr nt_ax)
; return (NewTyCon { data_con = con,
nt_rhs = rhs_ty,
nt_etad_rhs = (etad_tvs, etad_rhs),
- nt_co = co_tycon } ) }
+ nt_co = nt_ax } ) }
-- Coreview looks through newtypes with a Nothing
-- for nt_co, or uses explicit coercions otherwise
where