- | src_loc 'data' opt_decl_context qtc_name tv_bndrs constrs
- { mkTyData DataType $3 $4 $5 $6 (length $6) Nothing $1 }
- | src_loc 'newtype' opt_decl_context qtc_name tv_bndrs newtype_constr
- { mkTyData NewType $3 $4 $5 $6 1 Nothing $1 }
- | src_loc 'class' opt_decl_context qtc_name tv_bndrs fds csigs
- { mkClassDecl $3 $4 $5 $6 $7 Nothing $1 }
+ | src_loc 'data' tycl_hdr constrs
+ { mkTyData DataType $3 $4 (length $4) Nothing $1 }
+ | src_loc 'newtype' tycl_hdr newtype_constr
+ { mkTyData NewType $3 $4 1 Nothing $1 }
+ | src_loc 'class' tycl_hdr fds csigs
+ { mkClassDecl $3 $4 $5 Nothing $1 }
+
+tycl_hdr :: { (RdrNameContext, RdrName, [RdrNameHsTyVar]) }
+ : context '=>' qtc_name tv_bndrs { ($1, $3, $4) }
+ | qtc_name tv_bndrs { ([], $1, $2) }