diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2016-12-09 15:44:15 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-12-09 16:38:46 -0500 |
commit | 5349d648fd7af3f50953e8594b3d148ab073017f (patch) | |
tree | 65d79db9557d9b3b2cf3d0b41afbe363e5eb1d6d /compiler/typecheck/TcDeriv.hs | |
parent | d1df8d1c16b8f5bdf14ae41f514e38699f953054 (diff) | |
download | haskell-5349d648fd7af3f50953e8594b3d148ab073017f.tar.gz |
Rename TH constructors for deriving strategies
After talking to Richard, he and I concluded that choosing the rather
common name `Newtype` to represent the corresponding deriving strategy
in Template Haskell was a poor choice of name. I've opted to rename it
to something less common (`NewtypeStrategy`) while we still have time. I
also renamed the corrsponding datatype in the GHC internals so as to
match it.
Reviewers: austin, goldfire, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2814
GHC Trac Issues: #10598
Diffstat (limited to 'compiler/typecheck/TcDeriv.hs')
-rw-r--r-- | compiler/typecheck/TcDeriv.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index f3b5e6a987..4fcd690809 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -977,12 +977,12 @@ mkDataTypeEqn :: DynFlags mkDataTypeEqn dflags overlap_mode tvs cls cls_tys tycon tc_args rep_tc rep_tc_args mtheta deriv_strat = case deriv_strat of - Just DerivStock -> mk_eqn_stock dflags mtheta cls cls_tys rep_tc - go_for_it bale_out - Just DerivAnyclass -> mk_eqn_anyclass dflags rep_tc cls - go_for_it bale_out + Just StockStrategy -> mk_eqn_stock dflags mtheta cls cls_tys rep_tc + go_for_it bale_out + Just AnyclassStrategy -> mk_eqn_anyclass dflags rep_tc cls + go_for_it bale_out -- GeneralizedNewtypeDeriving makes no sense for non-newtypes - Just DerivNewtype -> bale_out gndNonNewtypeErr + Just NewtypeStrategy -> bale_out gndNonNewtypeErr -- Lacking a user-requested deriving strategy, we will try to pick -- between the stock or anyclass strategies Nothing -> mk_eqn_no_mechanism dflags tycon mtheta cls cls_tys rep_tc @@ -1100,11 +1100,11 @@ mkNewTypeEqn dflags overlap_mode tvs -- Want: instance (...) => cls (cls_tys ++ [tycon tc_args]) where ... = ASSERT( length cls_tys + 1 == classArity cls ) case deriv_strat of - Just DerivStock -> mk_eqn_stock dflags mtheta cls cls_tys rep_tycon - go_for_it_other bale_out - Just DerivAnyclass -> mk_eqn_anyclass dflags rep_tycon cls - go_for_it_other bale_out - Just DerivNewtype -> + Just StockStrategy -> mk_eqn_stock dflags mtheta cls cls_tys rep_tycon + go_for_it_other bale_out + Just AnyclassStrategy -> mk_eqn_anyclass dflags rep_tycon cls + go_for_it_other bale_out + Just NewtypeStrategy -> -- Since the user explicitly asked for GeneralizedNewtypeDeriving, we -- don't need to perform all of the checks we normally would, such as -- if the class being derived is known to produce ill-roled coercions |