1. 17 Nov, 2015 1 commit
  2. 16 Nov, 2015 3 commits
  3. 13 Nov, 2015 3 commits
  4. 11 Nov, 2015 1 commit
  5. 30 Oct, 2015 2 commits
    • Ben Gamari's avatar
      Generate Typeable info at definition sites · 91c6b1f5
      Ben Gamari authored
      This is the second attempt at merging D757.
      
      This patch implements the idea floated in Trac #9858, namely that we
      should generate type-representation information at the data type
      declaration site, rather than when solving a Typeable constraint.
      
      However, this turned out quite a bit harder than I expected. I still
      think it's the right thing to do, and it's done now, but it was quite
      a struggle.
      
      See particularly
      
       * Note [Grand plan for Typeable] in TcTypeable (which is a new module)
       * Note [The overall promotion story] in DataCon (clarifies existing
      stuff)
      
      The most painful bit was that to generate Typeable instances (ie
      TyConRepName bindings) for every TyCon is tricky for types in ghc-prim
      etc:
      
       * We need to have enough data types around to *define* a TyCon
       * Many of these types are wired-in
      
      Also, to minimise the code generated for each data type, I wanted to
      generate pure data, not CAFs with unpackCString# stuff floating about.
      
      Performance
      ~~~~~~~~~~~
      Three perf/compiler tests start to allocate quite a bit more. This isn't
      surprising, because they all allocate zillions of data types, with
      practically no other code, esp. T1969
      
       * T1969:    GHC allocates 19% more
       * T4801:    GHC allocates 13% more
       * T5321FD:  GHC allocates 13% more
       * T9675:    GHC allocates 11% more
       * T783:     GHC allocates 11% more
       * T5642:    GHC allocates 10% more
      
      I'm treating this as acceptable. The payoff comes in Typeable-heavy
      code.
      
      Remaining to do
      ~~~~~~~~~~~~~~~
      
       * I think that "TyCon" and "Module" are over-generic names to use for
         the runtime type representations used in GHC.Typeable. Better might
      be
         "TrTyCon" and "TrModule". But I have not yet done this
      
       * Add more info the the "TyCon" e.g. source location where it was
         defined
      
       * Use the new "Module" type to help with Trac Trac #10068
      
       * It would be possible to generate TyConRepName (ie Typeable
         instances) selectively rather than all the time. We'd need to persist
         the information in interface files. Lacking a motivating reason I
      have
         not done this, but it would not be difficult.
      
      Refactoring
      ~~~~~~~~~~~
      As is so often the case, I ended up refactoring more than I intended.
      In particular
      
       * In TyCon, a type *family* (whether type or data) is repesented by a
         FamilyTyCon
           * a algebraic data type (including data/newtype instances) is
             represented by AlgTyCon This wasn't true before; a data family
             was represented as an AlgTyCon. There are some corresponding
             changes in IfaceSyn.
      
           * Also get rid of the (unhelpfully named) tyConParent.
      
       * In TyCon define 'Promoted', isomorphic to Maybe, used when things are
         optionally promoted; and use it elsewhere in GHC.
      
       * Cleanup handling of knownKeyNames
      
       * Each TyCon, including promoted TyCons, contains its TyConRepName, if
         it has one. This is, in effect, the name of its Typeable instance.
      
      Updates haddock submodule
      
      Test Plan: Let Harbormaster validate
      
      Reviewers: austin, hvr, goldfire
      
      Subscribers: goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1404
      
      GHC Trac Issues: #9858
      91c6b1f5
    • Simon Peyton Jones's avatar
      Record usage information using GlobalRdrElt · 3e94842d
      Simon Peyton Jones authored
      This patch implements an improvment that I've wanted to do for ages, but
      never gotten around to.
      
      Unused imports are computed based on how imported entities occur (qualified,
      unqualified).   This info was accumulated in tcg_used_rdrnames :: Set RdrName.
      But that was a huge pain, and it got worse when we introduced duplicate
      record fields.
      
      The Right Thing is to record tcg_used_gres :: [GlobalRdrElt], which records
      the GRE *after* filtering with pickGREs.  See Note [GRE filtering] in RdrName.
      This is much, much bette.  This patch deletes quite a bit of code, and is
      conceptually much easier to follow.
      
      Hooray.  There should be no change in functionality.
      3e94842d
  6. 29 Oct, 2015 2 commits
    • Ben Gamari's avatar
      Revert "Generate Typeable info at definition sites" · bbaf76f9
      Ben Gamari authored
      This reverts commit bef2f03e.
      
      This merge was botched
      
      Also reverts haddock submodule.
      bbaf76f9
    • Ben Gamari's avatar
      Generate Typeable info at definition sites · bef2f03e
      Ben Gamari authored
      This patch implements the idea floated in Trac #9858, namely that we
      should generate type-representation information at the data type
      declaration site, rather than when solving a Typeable constraint.
      
      However, this turned out quite a bit harder than I expected. I still
      think it's the right thing to do, and it's done now, but it was quite
      a struggle.
      
      See particularly
      
       * Note [Grand plan for Typeable] in TcTypeable (which is a new module)
       * Note [The overall promotion story] in DataCon (clarifies existing stuff)
      
      The most painful bit was that to generate Typeable instances (ie
      TyConRepName bindings) for every TyCon is tricky for types in ghc-prim
      etc:
      
       * We need to have enough data types around to *define* a TyCon
       * Many of these types are wired-in
      
      Also, to minimise the code generated for each data type, I wanted to
      generate pure data, not CAFs with unpackCString# stuff floating about.
      
      Performance
      ~~~~~~~~~~~
      Three perf/compiler tests start to allocate quite a bit more. This isn't
      surprising, because they all allocate zillions of data types, with
      practically no other code, esp. T1969
      
       * T3294:   GHC allocates 110% more (filed #11030 to track this)
       * T1969:   GHC allocates 30% more
       * T4801:   GHC allocates 14% more
       * T5321FD: GHC allocates 13% more
       * T783:    GHC allocates 12% more
       * T9675:   GHC allocates 12% more
       * T5642:   GHC allocates 10% more
       * T9961:   GHC allocates 6% more
      
       * T9203:   Program allocates 54% less
      
      I'm treating this as acceptable. The payoff comes in Typeable-heavy
      code.
      
      Remaining to do
      ~~~~~~~~~~~~~~~
      
       * I think that "TyCon" and "Module" are over-generic names to use for
         the runtime type representations used in GHC.Typeable. Better might be
         "TrTyCon" and "TrModule". But I have not yet done this
      
       * Add more info the the "TyCon" e.g. source location where it was
         defined
      
       * Use the new "Module" type to help with Trac Trac #10068
      
       * It would be possible to generate TyConRepName (ie Typeable
         instances) selectively rather than all the time. We'd need to persist
         the information in interface files. Lacking a motivating reason I have
         not done this, but it would not be difficult.
      
      Refactoring
      ~~~~~~~~~~~
      As is so often the case, I ended up refactoring more than I intended.
      In particular
      
       * In TyCon, a type *family* (whether type or data) is repesented by a
         FamilyTyCon
           * a algebraic data type (including data/newtype instances) is
             represented by AlgTyCon This wasn't true before; a data family
             was represented as an AlgTyCon. There are some corresponding
             changes in IfaceSyn.
      
           * Also get rid of the (unhelpfully named) tyConParent.
      
       * In TyCon define 'Promoted', isomorphic to Maybe, used when things are
         optionally promoted; and use it elsewhere in GHC.
      
       * Cleanup handling of knownKeyNames
      
       * Each TyCon, including promoted TyCons, contains its TyConRepName, if
         it has one. This is, in effect, the name of its Typeable instance.
      
      Requires update of the haddock submodule.
      
      Differential Revision: https://phabricator.haskell.org/D757
      bef2f03e
  7. 17 Oct, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Make Monad/Applicative instances MRP-friendly · e8ed2136
      Herbert Valerio Riedel authored
      This patch refactors pure/(*>) and return/(>>) in MRP-friendly way, i.e.
      such that the explicit definitions for `return` and `(>>)` match the
      MRP-style default-implementation, i.e.
      
        return = pure
      
      and
      
        (>>) = (*>)
      
      This way, e.g. all `return = pure` definitions can easily be grepped and
      removed in GHC 8.1;
      
      Test Plan: Harbormaster
      
      Reviewers: goldfire, alanz, bgamari, quchen, austin
      
      Reviewed By: quchen, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1312
      e8ed2136
  8. 16 Oct, 2015 2 commits
    • Jan Stolarek's avatar
      Add typed holes support in Template Haskell. · 75492e74
      Jan Stolarek authored
      Fixes #10267. Typed holes in typed Template Haskell currently don't work.
      See #10945 and #10946.
      75492e74
    • Adam Gundry's avatar
      Implement DuplicateRecordFields · b1884b0e
      Adam Gundry authored
      This implements DuplicateRecordFields, the first part of the
      OverloadedRecordFields extension, as described at
      https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/DuplicateRecordFields
      
      This includes fairly wide-ranging changes in order to allow multiple
      records within the same module to use the same field names.  Note that
      it does *not* allow record selector functions to be used if they are
      ambiguous, and it does not have any form of type-based disambiguation
      for selectors (but it does for updates). Subsequent parts will make
      overloading selectors possible using orthogonal extensions, as
      described on the wiki pages.  This part touches quite a lot of the
      codebase, and requires changes to several GHC API datatypes in order
      to distinguish between field labels (which may be overloaded) and
      selector function names (which are always unique).
      
      The Haddock submodule has been adapted to compile with the GHC API
      changes, but it will need further work to properly support modules
      that use the DuplicateRecordFields extension.
      
      Test Plan: New tests added in testsuite/tests/overloadedrecflds; these
      will be extended once the other parts are implemented.
      
      Reviewers: goldfire, bgamari, simonpj, austin
      
      Subscribers: sjcjoosten, haggholm, mpickering, bgamari, tibbe, thomie,
      goldfire
      
      Differential Revision: https://phabricator.haskell.org/D761
      b1884b0e
  9. 15 Oct, 2015 1 commit
  10. 06 Oct, 2015 2 commits
    • Edward Z. Yang's avatar
      Documentation for FrontendResult · 59883ae3
      Edward Z. Yang authored
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      59883ae3
    • Edward Z. Yang's avatar
      Deduplicate one-shot/make compile paths. · 427f8a15
      Edward Z. Yang authored
      Summary:
      We had a duplicate copy of the code for --make and for -c
      which was a pain.  The call graph looked something like this:
      
          compileOne -> genericHscCompileGetFrontendResult -> genericHscFrontend
                                         hscCompileOneShot ---^
      
      with genericHscCompileGetFrontendResult and hscCompileOneShot
      duplicating logic for deciding whether or not recompilation
      was needed.
      
      This patchset fixes it, so now everything goes through this call-chain:
      
          compileOne (--make entry point)
              Calls hscIncrementCompile, invokes the pipeline to do codegen
              and sets up linkables.
          hscIncrementalCompile (-c entry point)
              Calls hscIncrementalFrontend, and then simplifying,
              desugaring, and writing out the interface.
          hscIncrementalFrontend
              Performs recompilation avoidance, if recompilation needed,
              does parses typechecking.
      
      I also cleaned up some of the MergeBoot nonsense by introducing
      a FrontendResult type.
      
      NB: this BREAKS #8101 again, because I can't unconditionally desugar
      due to Haddock barfing on lint, see #10600Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, bgamari, simonmar, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1302
      427f8a15
  11. 11 Sep, 2015 1 commit
    • Simon Peyton Jones's avatar
      A CFunEqCan can be Derived · a7f69097
      Simon Peyton Jones authored
      This fixes the ASSERTION failures in
        indexed-types/should_fail/T5439
        typecheck/should_fail/T5490
      when GHC is compiled with -DDEBUG
      
      See Phab:D202 attached to Trac #6018
      a7f69097
  12. 05 Aug, 2015 1 commit
    • Simon Peyton Jones's avatar
      Tidy up and refactor wildcard handling · 95364812
      Simon Peyton Jones authored
      When examining #10615, I found the wildcard handling hard
      to understand.  This patch refactors quite a bit, but with
      no real change in behaviour.
      
       * Split out TcIdSigInfo from TcSigInfo, as a separate type,
         like TcPatSynInfo.
      
       * Make TcIdSigInfo express more invariants by pushing the
         wildard info into TcIdSigBndr
      
       * Remove all special treatment of unification variables that arise
         from wildcards; so the TauTv of TcType.MetaInfo loses its Bool
         argument.
      
      A ton of konck on changes.  The result is significantly simpler, I think.
      95364812
  13. 27 Jul, 2015 1 commit
    • Simon Peyton Jones's avatar
      Improve warnings for rules that might not fire · 2d88a531
      Simon Peyton Jones authored
      Two main things here
      
      * Previously we only warned about the "head" function of the rule,
        but actually the warning applies to any free variable on the LHS.
      
      * We now warn not only when one of these free vars can inline, but
        also if it has an active RULE (c.f. Trac #10528)
      
      See Note [Rules and inlining/other rules] in Desugar
      
      This actually shows up quite a few warnings in the libraries, notably
      in Control.Arrow, where it correctly points out that rules like
          "compose/arr"   forall f g .
                          (arr f) . (arr g) = arr (f . g)
      might never fire, because the rule for 'arr' (dictionary selection)
      might fire first.  I'm not really sure what to do here; there is some
      discussion in Trac #10595.
      
      A minor change is adding BasicTypes.pprRuleName to pretty-print RuleName.
      2d88a531
  14. 21 Jul, 2015 1 commit
    • Simon Peyton Jones's avatar
      Refactor self-boot info · 3c44a46b
      Simon Peyton Jones authored
      This patch is a simple refactoring that prepares for a later one,
      related to Trac #10083.
      
      * Add a field tcg_self_boot :: SelfBootInfo to TcGblEnv,
        where SelfBootInfo is a new data type, describing the
        hi-boot file, if any, for the module being compiled.
      
      * Make tcHiBootIface return SelfBootInfo, a new data type
      
      * Make other functions get SelfBootInfo from the monad.
      
      * Remove tcg_mod_name from TcGblEnv; it was barely used and
        simpler to pass around explicitly.
      3c44a46b
  15. 15 Jul, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Fix #10642. · 9f978b67
      eir@cis.upenn.edu authored
      Representational equalities cannot discharge nominal ones.
      Even if, somehow, this didn't cause a type error (as reported
      in the ticket), it would surely cause a core lint error.
      9f978b67
  16. 26 Jun, 2015 2 commits
    • Simon Peyton Jones's avatar
      Kill off sizePred · 614ba3c5
      Simon Peyton Jones authored
      It really isn't needed, and life is simpler without
      614ba3c5
    • Simon Peyton Jones's avatar
      Treat out-of-scope variables as holes · fb7b6922
      Simon Peyton Jones authored
      This patch implements the idea in Trac #10569.
      
      * An out-of-scope variable is treated as a typed expression
        hole.
      
      * That is, we don't report it in the type checker, not the
        renamer, and we when we do report it, we give its type.
      
      * Moreover, we can defer the error to runtime with
        -fdefer-typed-holes
      
      In implementation terms:
      
      * The renamer turns an unbound variable into a HsUnboundVar
      
      * The type checker emits a Hole constraint for a
        HsUnboundVar, and turns it back into a HsVar
      
      It was a bit painful to implement because a whole raft of
      error messages change slightly.  But there was absolutely
      nothing hard in principle.
      
      Holes are reported with a bunch of possibly-useful context,
      notably the "relevant bindings".  I found that this was
      distracting clutter in the very common case of a mis-typed
      variable that is only accidentally not in scope, so I've
      arranged to print the context information only for true holes,
      that is ones starting with an underscore.
      
      Unbound data constructors use in patterns, like
        f (D x) = x
      are still reportd by the renamer, and abort compilation
      before type checking.
      fb7b6922
  17. 24 Jun, 2015 1 commit
  18. 18 Jun, 2015 1 commit
    • Simon Peyton Jones's avatar
      Remove some horrible munging of origins for Coercible · 02bac025
      Simon Peyton Jones authored
      I just didn't think it was buying enough for all the cruft it caused.
      We can put some back if people start complaining about poor error
      messages. I forget quite how I tripped over this but I got sucked in.
      
      * Lots of tidying up in TcErrors
      
      * Rename pprArisingAt to pprCtLoc, by analogy with pprCtOrigin
      
      * Remove CoercibleOrigin data constructor from CtOrigin
      
      * Make relevantBindings return a Ct with a zonked
        and tidied CtOrigin
      
      * Add to TcRnTypes
            ctOrigin   :: Ct -> CtOrigin
            ctEvOrigin :: CtEvidence -> CtOrigin
            setCtLoc   :: Ct -> CtLoc -> Ct
      02bac025
  19. 11 Jun, 2015 2 commits
    • Edward Z. Yang's avatar
      Remove redundant tcg_visible_orphan_mods, it is recorded in imp_orphs. · 28e04de3
      Edward Z. Yang authored
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin
      
      Subscribers: bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D947
      28e04de3
    • Simon Peyton Jones's avatar
      Another major improvement of "improvement" · ddbb97d0
      Simon Peyton Jones authored
      I wasn't very happy with my fix to Trac #10009. This is much better.
      
      The main idea is that the inert set now contains a "model", which
      embodies *all* the (nominal) equalities that we know about, with
      a view to exposing unifications.  This requires a lot fewer iterations
      of the solver than before.
      
      There are extensive comments in
       TcSMonad:  Note [inert_model: the inert model]
                  Note [Adding an inert canonical constraint the InertCans]
      
      The big changes are
      
        * New inert_model field in InertCans
      
        * Functions addInertEq, addInertCan deal with adding a
          constraint, maintaining the model
      
        * A nice improvement is that unification variables can
          unify with fmvs, so that from, say   alpha ~ fmv
          we get              alpha := fmv
          See Note [Orientation of equalities with fmvs] in TcFlatten
          It's still not perfect, as the Note explains
      
      New flag -fconstraint-solver-iterations=n, allows us to control
      the number of constraint solver iterations, and in particular
      will flag up when it's more than a small number.
      
      Performance is generally slightly better:
      T5837 is a lot better for some reason.
      ddbb97d0
  20. 01 Jun, 2015 2 commits
  21. 12 May, 2015 1 commit
    • David Terei's avatar
      New handling of overlapping inst in Safe Haskell · 4fffbc34
      David Terei authored
      We do much better now due to the newish per-instance flags. Rather than
      mark any module that uses `-XOverlappingInstances`,
      `-XIncoherentInstances` or the new `OVERLAP*` pragmas as unsafe, we
      regard them all as safe and defer the check until an overlap occurs.
      
      An type-class method call that involves overlapping instances is
      considered _unsafe_ when:
      
      1) The most specific instance, Ix, is from a module marked `-XSafe`
      2) Ix is an orphan instance or a MPTC
      3) At least one instance that Ix overlaps, Iy, is:
         a) from a different module than Ix
         AND
         b) Iy is not marked `OVERLAPPABLE`
      
      This check is only enforced in modules compiled with `-XSafe` or
      `-XTrustworthy`.
      
      This fixes Safe Haskell to work with the latest overlapping instance
      pragmas, and also brings consistent behavior. Previously, Safe Inferred
      modules behaved differently than `-XSafe` modules.
      4fffbc34
  22. 30 Apr, 2015 1 commit
  23. 29 Apr, 2015 1 commit
    • Simon Peyton Jones's avatar
      Improve improvement in the constraint solver · a1275a76
      Simon Peyton Jones authored
      This regrettably-big patch substantially improves the way in which
      "improvement" happens in the constraint solver.  It was triggered by
      trying to crack Trac #10009, but it turned out to solve #10340 as
      well.
      
      The big picture, with several of the trickiest examples, is described
      in Note [The improvement story] in TcInteract.
      
      The major change is this:
      
      * After solving we explicitly try "improvement", by
           - making the unsolved Wanteds into Deriveds
           - allowing Deriveds to rewrite Deriveds
        This more aggressive rewriting "unlocks" some extra
        guess-free unifications.
      
      * The main loop is in TcInteract.solveSimpleWanteds, but I also ended
        up refactoring TcSimplify.simpl_loop, and its surrounding code.
      
        Notably, any insolubles from the Givens are pulled out
        and treated separately, rather than staying in the inert set
        during the solveSimpleWanteds loop.
      
      There are a lot of follow-on changes
      
      * Do not emit generate Derived improvements from Wanteds.
        This saves work in the common case where they aren't needed.
      
      * For improvement we should really do type-class reduction on Derived
        constraints in doTopReactDict.  That entailed changing the GenInst
        constructor a bit; a local and minor change
      
      * Some annoying faffing about with dropping derived constraints;
        see dropDerivedWC, dropDerivedSimples, dropDerivedInsols,
        and their Notes.
      
      * Some substantial refactoring in TcErrors.reportWanteds.
        This work wasn't strictly forced, but I got sucked into it.
        All the changes are in TcErrors.
      
      * Use TcS.unifyTyVar consistently, rather than setWantedTyBind,
        so that unifications are properly tracked.
      
      * Refactoring around solveWantedsTcM, solveWantedsAndDrop.
        They previously guaranteed a zonked result, but it's more
        straightforward for clients to zonk.
      a1275a76
  24. 17 Apr, 2015 1 commit
  25. 09 Apr, 2015 1 commit
  26. 24 Mar, 2015 1 commit
    • Simon Peyton Jones's avatar
      Improve environment handling in TcBinds · 8eaa70a6
      Simon Peyton Jones authored
      This is a minor refactoring, but it simplifies the code quite a bit
      
      * Decrease the number of variants of tcExtend in TcEnv
      * Remove "not_actually_free" from TcEnv.tc_extend_local_env2
      * Simplify plumbingof the "closed" flag
      * Remove redundant scoping of wild-card variables
      8eaa70a6
  27. 23 Mar, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Do proper depth checking in the flattener to avoid looping. · c1edbdfd
      eir@cis.upenn.edu authored
      This implements (roughly) the plan put forward in comment:14:ticket:7788,
      fixing #7788, #8550, #9554, #10139, and addressing concerns raised in #10079.
      There are some regressions w.r.t. GHC 7.8, but only with pathological type
      families (like F a = F a). This also (hopefully -- don't have a test case)
      fixes #10158. Unsolved problems include #10184 and #10185, which are both
      known deficiencies of the approach used here.
      
      As part of this change, the plumbing around detecting infinite loops has
      changed. Instead of -fcontext-stack and -ftype-function-depth, we now have
      one combined -freduction-depth parameter. Setting it to 0 disbales the
      check, which is now the recommended way to get (terminating) code to
      typecheck in releases. (The number of reduction steps may well change between
      minor GHC releases!)
      
      This commit also introduces a new IntWithInf type in BasicTypes
      that represents an integer+infinity. This type is used in a few
      places throughout the code.
      
      Tests in
        indexed-types/should_fail/T7788
        indexed-types/should_fail/T8550
        indexed-types/should_fail/T9554
        indexed-types/should_compile/T10079
        indexed-types/should_compile/T10139
        typecheck/should_compile/T10184  (expected broken)
        typecheck/should_compile/T10185  (expected broken)
      
      This commit also changes performance testsuite numbers, for the better.
      c1edbdfd
  28. 17 Mar, 2015 1 commit
  29. 23 Feb, 2015 1 commit
    • thomie's avatar
      Error out on `Main` without `main` in GHCi (#7765) · 0fa20726
      thomie authored
      Summary:
      GHC does 2 validation checks for module `Main`:
      * does `main` exist
      * is `main` exported (#414)
      
      The second check is done in ghc as well as in ghci (and runghc and ghc -e).
      The first check however is currently not done in ghci, to prevent "'main' is
      not in scope" errors when loading simple scripts. See commit d28ba8c8 for
      more information.
      
      This commit tightens the special case for ghci. When the file does not contain
      a main function, but does contain an explicit module header (i.e. "module Main
      where"), then /do/ raise an error in ghci (and runghc and ghc -e) as well
      
      Test Plan:
      module/T7765: a module Main with an explicit module header but without a
      main function should be an error for all Ways.
      
      Additionaly: delete test module/mod174. It was added in commit 5a54c38e, but it
      is a duplicate of module/T414.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D649
      
      GHC Trac Issues: #7765
      0fa20726