X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FTcIface.lhs;h=7db955162fb2122ecd2161db8a036eb492163266;hb=eb4427afd02f653087fa3d2720193b625b6411ee;hp=a9091f21113e284a6767e4b9b56050721c0343e1;hpb=48b625149fdcf14a91422d4dfdb44d096dde5bb0;p=ghc-hetmet.git diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index a9091f2..7db9551 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -19,7 +19,6 @@ import LoadIface import IfaceEnv import BuildTyCl import TcRnMonad -import TcType ( tcSplitSigmaTy ) import Type import TypeRep import HscTypes @@ -43,7 +42,6 @@ import qualified Var import VarEnv import Name import NameEnv -import OccName import Module import LazyUniqFM import UniqSupply @@ -58,7 +56,6 @@ import BasicTypes (Arity) import Control.Monad import Data.List -import Data.Maybe \end{code} This module takes @@ -418,7 +415,7 @@ tcIfaceDecl ignore_prags (IfaceId {ifName = occ_name, ifType = iface_type, ifIdDetails = details, ifIdInfo = info}) = do { name <- lookupIfaceTop occ_name ; ty <- tcIfaceType iface_type - ; details <- tcIdDetails ty details + ; details <- tcIdDetails details ; info <- tcIdInfo ignore_prags name ty info ; return (AnId (mkGlobalId details name ty info)) } @@ -966,16 +963,12 @@ do_one (IfaceRec pairs) thing_inside %************************************************************************ \begin{code} -tcIdDetails :: Type -> IfaceIdDetails -> IfL IdDetails -tcIdDetails _ IfVanillaId = return VanillaId -tcIdDetails _ IfDFunId = return DFunId -tcIdDetails ty (IfRecSelId naughty) - = return (RecSelId { sel_tycon = tc, sel_naughty = naughty }) - where - (_, _, tau) = tcSplitSigmaTy ty - tc = tyConAppTyCon (funArgTy tau) - -- A bit fragile. Relies on the selector type looking like - -- forall abc. (stupid-context) => T a b c -> blah +tcIdDetails :: IfaceIdDetails -> IfL IdDetails +tcIdDetails IfVanillaId = return VanillaId +tcIdDetails IfDFunId = return DFunId +tcIdDetails (IfRecSelId tc naughty) + = do { tc' <- tcIfaceTyCon tc + ; return (RecSelId { sel_tycon = tc', sel_naughty = naughty }) } tcIdInfo :: Bool -> Name -> Type -> IfaceIdInfo -> IfL IdInfo tcIdInfo ignore_prags name ty info