X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsDecls.lhs;h=37ab35a606ee29483c22db628e5d827134166026;hb=74b27e20425336403d80e942ee3faf00f8c36ef8;hp=1822b58775adff36686358916c593737595b9c05;hpb=5d0b2bba1dfc0b2786162927ed7b3d4911f1cc54;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index 1822b58..37ab35a 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -358,7 +358,7 @@ Interface file code: -- -- * If it is 'Just pats', we have the definition of an indexed type. Then, -- 'pats' are type patterns for the type-indexes of the type constructor --- and 'tcdVars' are the variables in those patterns. Hence, the arity of +-- and 'tcdTyVars' are the variables in those patterns. Hence, the arity of -- the indexed type (ie, the number of indexes) is 'length tcdTyPats' and -- *not* 'length tcdVars'. -- @@ -373,12 +373,16 @@ data TyClDecl name tcdFoType :: FoType } + -- type/data/newtype family T :: *->* | TyFamily { tcdFlavour:: FamilyFlavour, -- type, new, or data tcdLName :: Located name, -- type constructor tcdTyVars :: [LHsTyVarBndr name], -- type variables tcdKind :: Maybe Kind -- result kind } + -- Declares a data type or newtype, giving its construcors + -- data/newtype T a = + -- data/newtype instance T [a] = | TyData { tcdND :: NewOrData, tcdCtxt :: LHsContext name, -- Context tcdLName :: Located name, -- Type constructor @@ -406,9 +410,6 @@ data TyClDecl name -- Typically the foralls and ty args are empty, but they -- are non-empty for the newtype-deriving case } - -- data instance: tcdPats = Just tys - -- - -- data: tcdPats = Nothing, | TySynonym { tcdLName :: Located name, -- type constructor tcdTyVars :: [LHsTyVarBndr name], -- type variables @@ -439,7 +440,7 @@ data NewOrData data FamilyFlavour = TypeFamily -- "type family ..." - | DataFamily NewOrData -- "newtype family ..." or "data family ..." + | DataFamily -- "data family ..." \end{code} Simple classifiers @@ -535,9 +536,8 @@ instance OutputableBndr name = pp_flavour <+> pp_decl_head [] ltycon tyvars Nothing <+> pp_kind where pp_flavour = case flavour of - TypeFamily -> ptext SLIT("type family") - DataFamily NewType -> ptext SLIT("newtype family") - DataFamily DataType -> ptext SLIT("data family") + TypeFamily -> ptext SLIT("type family") + DataFamily -> ptext SLIT("data family") pp_kind = case mb_kind of Nothing -> empty