diff options
Diffstat (limited to 'compiler/iface/IfaceSyn.lhs')
| -rw-r--r-- | compiler/iface/IfaceSyn.lhs | 15 | 
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index a41a9dac47..06c7b67ba6 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -35,6 +35,7 @@ module IfaceSyn (  #include "HsVersions.h" +import TyCon( SynTyConRhs(..) )  import IfaceType  import CoreSyn( DFunArg, dfunArgExprs )  import PprCore()            -- Printing DFunArgs @@ -89,9 +90,7 @@ data IfaceDecl    | IfaceSyn  { ifName    :: OccName,           -- Type constructor                  ifTyVars  :: [IfaceTvBndr],     -- Type variables                  ifSynKind :: IfaceKind,         -- Kind of the *rhs* (not of the tycon) -                ifSynRhs  :: Maybe IfaceType    -- Just rhs for an ordinary synonyn -                                                -- Nothing for an type family declaration -    } +                ifSynRhs  :: SynTyConRhs IfaceType }    | IfaceClass { ifCtxt    :: IfaceContext,     -- Context...                   ifName    :: OccName,          -- Name of the class TyCon @@ -487,12 +486,12 @@ pprIfaceDecl (IfaceForeign {ifName = tycon})  pprIfaceDecl (IfaceSyn {ifName = tycon,                          ifTyVars = tyvars, -                        ifSynRhs = Just mono_ty}) +                        ifSynRhs = SynonymTyCon mono_ty})    = hang (ptext (sLit "type") <+> pprIfaceDeclHead [] tycon tyvars)         4 (vcat [equals <+> ppr mono_ty])  pprIfaceDecl (IfaceSyn {ifName = tycon, ifTyVars = tyvars, -                        ifSynRhs = Nothing, ifSynKind = kind }) +                        ifSynRhs = SynFamilyTyCon {}, ifSynKind = kind })    = hang (ptext (sLit "type family") <+> pprIfaceDeclHead [] tycon tyvars)         4 (dcolon <+> ppr kind) @@ -797,9 +796,9 @@ freeNamesIfIdDetails (IfRecSelId tc _) = freeNamesIfTc tc  freeNamesIfIdDetails _                 = emptyNameSet  -- All other changes are handled via the version info on the tycon -freeNamesIfSynRhs :: Maybe IfaceType -> NameSet -freeNamesIfSynRhs (Just ty) = freeNamesIfType ty -freeNamesIfSynRhs Nothing   = emptyNameSet +freeNamesIfSynRhs :: SynTyConRhs IfaceType -> NameSet +freeNamesIfSynRhs (SynonymTyCon ty) = freeNamesIfType ty +freeNamesIfSynRhs _                 = emptyNameSet  freeNamesIfContext :: IfaceContext -> NameSet  freeNamesIfContext = fnList freeNamesIfType  | 
