; gen_binds <- mkGenericBinds tycl_decls
-- Rename these extra bindings, discarding warnings about unused bindings etc
- -- Set -fglasgow exts so that we can have type signatures in patterns,
- -- which is used in the generic binds
+ -- Type signatures in patterns are used in the generic binds
; rn_binds
- <- discardWarnings $ setOptM Opt_GlasgowExts $ do
+ <- discardWarnings $
+ setOptM Opt_PatternSignatures $
+ do
{ (rn_deriv, _dus1) <- rnTopBinds (ValBindsIn deriv_binds [])
; (rn_gen, dus_gen) <- rnTopBinds (ValBindsIn gen_binds [])
; keepAliveSetTc (duDefs dus_gen) -- Mark these guys to
; (rep_tc, rep_tc_args) <- tcLookupFamInstExact tycon full_tc_args
- ; mayDeriveDataTypeable <- doptM Opt_GlasgowExts
+ ; mayDeriveDataTypeable <- doptM Opt_DeriveDataTypeable
; newtype_deriving <- doptM Opt_GeneralizedNewtypeDeriving
; overlap_flag <- getOverlapFlag
mb_std_err = checkSideConditions mayDeriveDataTypeable cls cls_tys rep_tycon
std_err = derivingThingErr cls cls_tys tc_app $
vcat [fromJust mb_std_err,
- ptext SLIT("Try -fglasgow-exts for GHC's newtype-deriving extension")]
+ ptext SLIT("Try -XGeneralizedNewtypeDeriving for GHC's newtype-deriving extension")]
-- Here is the plan for newtype derivings. We see
-- newtype T a1...an = MkT (t ak+1...an) deriving (.., C s1 .. sm, ...)