summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4d4fd00)
In an interface file, don't allow data and newtype decls to have deriving clauses (not needed.)
| ITdata
| ITtype
| ITnewtype
| ITdata
| ITtype
| ITnewtype
| ITclass
| ITwhere
| ITinstance
| ITclass
| ITwhere
| ITinstance
,("of", ITof)
,("in", ITin)
,("let", ITlet)
,("of", ITof)
,("in", ITin)
,("let", ITlet)
- ,("deriving", ITderiving)
,("->", ITrarrow)
,("\\", ITlam)
,("->", ITrarrow)
,("\\", ITlam)
DATA { ITdata }
TYPE { ITtype }
NEWTYPE { ITnewtype }
DATA { ITdata }
TYPE { ITtype }
NEWTYPE { ITnewtype }
- DERIVING { ITderiving }
CLASS { ITclass }
WHERE { ITwhere }
INSTANCE { ITinstance }
CLASS { ITclass }
WHERE { ITwhere }
INSTANCE { ITinstance }
topdecl :: { RdrNameHsDecl }
topdecl : src_loc TYPE tc_name tv_bndrs EQUAL type SEMI
{ TyD (TySynonym $3 $4 $6 $1) }
topdecl :: { RdrNameHsDecl }
topdecl : src_loc TYPE tc_name tv_bndrs EQUAL type SEMI
{ TyD (TySynonym $3 $4 $6 $1) }
- | src_loc DATA decl_context tc_name tv_bndrs constrs deriving SEMI
- { TyD (TyData DataType $3 $4 $5 $6 $7 noDataPragmas $1) }
- | src_loc NEWTYPE decl_context tc_name tv_bndrs newtype_constr deriving SEMI
- { TyD (TyData NewType $3 $4 $5 $6 $7 noDataPragmas $1) }
+ | src_loc DATA decl_context tc_name tv_bndrs constrs SEMI
+ { TyD (TyData DataType $3 $4 $5 $6 Nothing noDataPragmas $1) }
+ | src_loc NEWTYPE decl_context tc_name tv_bndrs newtype_constr SEMI
+ { TyD (TyData NewType $3 $4 $5 $6 Nothing noDataPragmas $1) }
| src_loc CLASS decl_context tc_name tv_bndrs csigs SEMI
{ ClD (mkClassDecl $3 $4 $5 $6 EmptyMonoBinds noClassPragmas $1) }
| src_loc var_name TYPE_PART
| src_loc CLASS decl_context tc_name tv_bndrs csigs SEMI
{ ClD (mkClassDecl $3 $4 $5 $6 EmptyMonoBinds noClassPragmas $1) }
| src_loc var_name TYPE_PART
newtype_constr : { [] }
| src_loc EQUAL data_name atype { [ConDecl $3 [] (NewCon $4) $1] }
newtype_constr : { [] }
| src_loc EQUAL data_name atype { [ConDecl $3 [] (NewCon $4) $1] }
-deriving :: { Maybe [RdrName] }
- : { Nothing }
- | DERIVING OPAREN tc_names1 CPAREN { Just $3 }
-
batypes :: { [RdrNameBangType] }
batypes : { [] }
| batype batypes { $1 : $2 }
batypes :: { [RdrNameBangType] }
batypes : { [] }
| batype batypes { $1 : $2 }