Skip to content

Refactor some cruft in TcDeriv

Ryan Scott requested to merge RyanGlScott/ghc:remove-TcDeriv-cruft into master
  • mk_eqn_stock, mk_eqn_anyclass, and mk_eqn_no_mechanism all took a continuation of type DerivSpecMechanism -> DerivM EarlyDerivSpec to represent its primary control flow. However, in practice this continuation was always instantiated with the mk_originative_eqn function, so there's not much point in making this be a continuation in the first place.

    This patch removes these continuations in favor of invoking mk_originative_eqn directly, which is simpler.

  • There were several parts of TcDeriv that took different code paths if compiling an .hs-boot file. But this is silly, because ever since 101a8c77 we simply error eagerly whenever attempting to derive any instances in an .hs-boot file.

    This patch removes all of the unnecessary .hs-boot code paths, leaving only one (which errors out).

  • Remove various error continuation arguments from mk_eqn_stock and related functions.

Edited by Ryan Scott

Merge request reports