summaryrefslogtreecommitdiff
path: root/compiler/iface/TcIface.lhs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-09-17 11:54:20 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-09-18 17:30:15 +0100
commit58470fb7b4a25c49b567e08740dc8df01a6c3710 (patch)
tree727201b8e30dd42cbb53d15e03571c3bcbb43b79 /compiler/iface/TcIface.lhs
parentaf7cc9953217d74e88d4d21512e957edd8e97ec9 (diff)
downloadhaskell-58470fb7b4a25c49b567e08740dc8df01a6c3710.tar.gz
Make a start towards eta-rules and injective families
* Make Any into a type family (which it should always have been) This is to support the future introduction of eta rules for product types (see email on ghc-users title "PolyKind issue" early Sept 2012) * Add the *internal* data type support for (a) closed type families [so that you can't give type instance for 'Any'] (b) injective type families [because Any is really injective] This amounts to two boolean flags on the SynFamilyTyCon constructor of TyCon.SynTyConRhs. There is some knock-on effect, but all of a routine nature. It remains to offer source syntax for either closed or injective families.
Diffstat (limited to 'compiler/iface/TcIface.lhs')
-rw-r--r--compiler/iface/TcIface.lhs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs
index eb9e5ddb80..b9783a8d4f 100644
--- a/compiler/iface/TcIface.lhs
+++ b/compiler/iface/TcIface.lhs
@@ -474,9 +474,9 @@ tc_iface_decl parent _ (IfaceSyn {ifName = occ_name, ifTyVars = tv_bndrs,
; return (ATyCon tycon) }
where
mk_doc n = ptext (sLit "Type syonym") <+> ppr n
- tc_syn_rhs Nothing = return SynFamilyTyCon
- tc_syn_rhs (Just ty) = do { rhs_ty <- tcIfaceType ty
- ; return (SynonymTyCon rhs_ty) }
+ tc_syn_rhs (SynFamilyTyCon a b) = return (SynFamilyTyCon a b)
+ tc_syn_rhs (SynonymTyCon ty) = do { rhs_ty <- tcIfaceType ty
+ ; return (SynonymTyCon rhs_ty) }
tc_iface_decl _parent ignore_prags
(IfaceClass {ifCtxt = rdr_ctxt, ifName = tc_occ,