summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3d5a372)
Rename ifaceTyCls to ifaceTyThing (more consistent)
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.91 2001/08/20 16:17:17 simonmar Exp $
+-- $Id: InteractiveUI.hs,v 1.92 2001/10/15 15:05:17 simonpj Exp $
--
-- GHC Interactive User Interface
--
--
-- GHC Interactive User Interface
--
showThing (ty_thing, fixity)
= vcat [ text "-- " <> showTyThing ty_thing,
showFixity fixity (getName ty_thing),
showThing (ty_thing, fixity)
= vcat [ text "-- " <> showTyThing ty_thing,
showFixity fixity (getName ty_thing),
- ppr (ifaceTyCls ty_thing) ]
+ ppr (ifaceTyThing ty_thing) ]
showFixity fix name
| fix == defaultFixity = empty
showFixity fix name
| fix == defaultFixity = empty
ppr_con_details con (InfixCon ty1 ty2)
= hsep [ppr_bang ty1, ppr con, ppr_bang ty2]
ppr_con_details con (InfixCon ty1 ty2)
= hsep [ppr_bang ty1, ppr con, ppr_bang ty2]
--- ConDecls generated by MkIface.ifaceTyCls always have a VanillaCon, even
+-- ConDecls generated by MkIface.ifaceTyThing always have a VanillaCon, even
-- if the constructor is an infix one. This is because in an interface file
-- we don't distinguish between the two. Hence when printing these for the
-- user, we need to parenthesise infix constructor names.
-- if the constructor is an infix one. This is because in an interface file
-- we don't distinguish between the two. Hence when printing these for the
-- user, we need to parenthesise infix constructor names.
module MkIface (
mkFinalIface,
pprModDetails, pprIface, pprUsage,
module MkIface (
mkFinalIface,
pprModDetails, pprIface, pprUsage,
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
hi_file_path = ml_hi_file location
new_decls = mkIfaceDecls ty_cls_dcls rule_dcls inst_dcls
inst_dcls = map ifaceInstance (md_insts new_details)
hi_file_path = ml_hi_file location
new_decls = mkIfaceDecls ty_cls_dcls rule_dcls inst_dcls
inst_dcls = map ifaceInstance (md_insts new_details)
- ty_cls_dcls = foldNameEnv ifaceTyCls_acc [] (md_types new_details)
+ ty_cls_dcls = foldNameEnv ifaceTyThing_acc [] (md_types new_details)
rule_dcls = map ifaceRule (md_rules new_details)
orphan_mod = isOrphanModule (mi_module new_iface) new_details
rule_dcls = map ifaceRule (md_rules new_details)
orphan_mod = isOrphanModule (mi_module new_iface) new_details
we miss them out of the accumulating parameter here.
\begin{code}
we miss them out of the accumulating parameter here.
\begin{code}
-ifaceTyCls_acc :: TyThing -> [RenamedTyClDecl] -> [RenamedTyClDecl]
-ifaceTyCls_acc (AnId id) so_far | isImplicitId id = so_far
-ifaceTyCls_acc (ATyCon id) so_far | isClassTyCon id = so_far
-ifaceTyCls_acc other so_far = ifaceTyCls other : so_far
+ifaceTyThing_acc :: TyThing -> [RenamedTyClDecl] -> [RenamedTyClDecl]
+ifaceTyThing_acc (AnId id) so_far | isImplicitId id = so_far
+ifaceTyThing_acc (ATyCon id) so_far | isClassTyCon id = so_far
+ifaceTyThing_acc other so_far = ifaceTyThing other : so_far
\end{code}
Convert *any* TyThing into a RenamedTyClDecl. Used both for
generating interface files and for the ':info' command in GHCi.
\begin{code}
\end{code}
Convert *any* TyThing into a RenamedTyClDecl. Used both for
generating interface files and for the ':info' command in GHCi.
\begin{code}
-ifaceTyCls :: TyThing -> RenamedTyClDecl
-ifaceTyCls (AClass clas) = cls_decl
+ifaceTyThing :: TyThing -> RenamedTyClDecl
+ifaceTyThing (AClass clas) = cls_decl
where
cls_decl = ClassDecl { tcdCtxt = toHsContext sc_theta,
tcdName = getName clas,
where
cls_decl = ClassDecl { tcdCtxt = toHsContext sc_theta,
tcdName = getName clas,
GenDefMeth -> GenDefMeth
DefMeth id -> DefMeth (getName id)
GenDefMeth -> GenDefMeth
DefMeth id -> DefMeth (getName id)
-ifaceTyCls (ATyCon tycon) = ty_decl
+ifaceTyThing (ATyCon tycon) = ty_decl
where
ty_decl | isSynTyCon tycon
= TySynonym { tcdName = getName tycon,
where
ty_decl | isSynTyCon tycon
= TySynonym { tcdName = getName tycon,
tcdSysNames = [],
tcdLoc = noSrcLoc }
tcdSysNames = [],
tcdLoc = noSrcLoc }
- | otherwise = pprPanic "ifaceTyCls" (ppr tycon)
+ | otherwise = pprPanic "ifaceTyThing" (ppr tycon)
tyvars = tyConTyVars tycon
(_, syn_ty) = getSynTyConDefn tycon
tyvars = tyConTyVars tycon
(_, syn_ty) = getSynTyConDefn tycon
mk_field strict_mark field_label
= ([getName field_label], BangType strict_mark (toHsType (fieldLabelType field_label)))
mk_field strict_mark field_label
= ([getName field_label], BangType strict_mark (toHsType (fieldLabelType field_label)))
-ifaceTyCls (AnId id) = iface_sig
+ifaceTyThing (AnId id) = iface_sig
where
iface_sig = IfaceSig { tcdName = getName id,
tcdType = toHsType id_type,
where
iface_sig = IfaceSig { tcdName = getName id,
tcdType = toHsType id_type,