X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsDecls.lhs;h=cd04a1a7e00147b0da88e08ec02e900df404f0ff;hb=9f55c592f7283e5d16dd406c767af352adf30bfc;hp=644050e6b2649734312b968ab7027028476127fb;hpb=9bcd95bad83ee937c178970e8b729732e680fe1e;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index 644050e..cd04a1a 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -406,8 +406,8 @@ data TyClDecl name } - | -- | @type/data/newtype family T :: *->*@ - TyFamily { tcdFlavour:: FamilyFlavour, -- type, new, or data + | -- | @type/data family T :: *->*@ + TyFamily { tcdFlavour:: FamilyFlavour, -- type or data tcdLName :: Located name, -- type constructor tcdTyVars :: [LHsTyVarBndr name], -- type variables tcdKind :: Maybe Kind -- result kind @@ -534,10 +534,10 @@ tcdName :: TyClDecl name -> name tcdName decl = unLoc (tcdLName decl) tyClDeclNames :: Eq name => TyClDecl name -> [Located name] --- Returns all the *binding* names of the decl, along with their SrcLocs --- The first one is guaranteed to be the name of the decl --- For record fields, the first one counts as the SrcLoc --- We use the equality to filter out duplicate field names +-- ^ Returns all the /binding/ names of the decl, along with their SrcLocs. +-- The first one is guaranteed to be the name of the decl. For record fields +-- mentioned in multiple constructors, the SrcLoc will be from the first +-- occurence. We use the equality to filter out duplicate field names tyClDeclNames (TyFamily {tcdLName = name}) = [name] tyClDeclNames (TySynonym {tcdLName = name}) = [name] @@ -693,22 +693,33 @@ type LConDecl name = Located (ConDecl name) data ConDecl name = ConDecl - { con_name :: Located name -- Constructor name; this is used for the - -- DataCon itself, and for the user-callable wrapper Id + { con_name :: Located name + -- ^ Constructor name. This is used for the DataCon itself, and for + -- the user-callable wrapper Id. - , con_explicit :: HsExplicitForAll -- Is there an user-written forall? (cf. HStypes.HsForAllTy) + , con_explicit :: HsExplicitForAll + -- ^ Is there an user-written forall? (cf. 'HsTypes.HsForAllTy') - , con_qvars :: [LHsTyVarBndr name] -- ResTyH98: the constructor's existential type variables - -- ResTyGADT: all the constructor's quantified type variables + , con_qvars :: [LHsTyVarBndr name] + -- ^ Type variables. Depending on 'con_res' this describes the + -- follewing entities + -- + -- - ResTyH98: the constructor's existential type variables + -- + -- - ResTyGADT: all the constructor's quantified type variables - , con_cxt :: LHsContext name -- The context. This *does not* include the - -- "stupid theta" which lives only in the TyData decl + , con_cxt :: LHsContext name + -- ^ The context. This /does not/ include the \"stupid theta\" which + -- lives only in the 'TyData' decl. - , con_details :: HsConDeclDetails name -- The main payload + , con_details :: HsConDeclDetails name + -- ^ The main payload - , con_res :: ResType name -- Result type of the constructor + , con_res :: ResType name + -- ^ Result type of the constructor - , con_doc :: Maybe (LHsDoc name) -- A possible Haddock comment + , con_doc :: Maybe (LHsDoc name) + -- ^ A possible Haddock comment. } type HsConDeclDetails name = HsConDetails (LBangType name) [ConDeclField name]