1. 29 Mar, 2020 1 commit
  2. 21 Mar, 2020 1 commit
    • Richard Eisenberg's avatar
      Update core spec to reflect changes to Core. · 9a96ff6b
      Richard Eisenberg authored
      Key changes:
       * Adds a new rule for forall-coercions over coercion variables, which
      was implemented but conspicuously missing from the spec.
       * Adds treatment for FunCo.
       * Adds treatment for ForAllTy over coercion variables.
       * Improves commentary (including restoring a Note lost in
      03d48526) in the source.
      No changes to running code.
  3. 19 Mar, 2020 1 commit
  4. 18 Mar, 2020 1 commit
  5. 17 Mar, 2020 2 commits
    • Richard Eisenberg's avatar
      Fix #17021 by checking more return kinds · 53ff2cd0
      Richard Eisenberg authored
      All the details are in new Note [Datatype return kinds] in
      Test case: typecheck/should_fail/T17021{,b}
      Updates haddock submodule
    • MaxGabriel's avatar
      Document the units of -ddump-timings · 89f034dd
      MaxGabriel authored
      Right now, in the output of -ddump-timings to a file, you can't tell what the units are:
      CodeGen [TemplateTestImports]: alloc=22454880 time=14.597
      I believe bytes/milliseconds are the correct units, but confirmation would be appreciated. I'm basing it off of this snippet from `withTiming'`:
      when (verbosity dflags >= 2 && prtimings == PrintTimings)
        $ liftIO $ logInfo dflags (defaultUserStyle dflags)
            (text "!!!" <+> what <> colon <+> text "finished in"
             <+> doublePrec 2 time
             <+> text "milliseconds"
             <> comma
             <+> text "allocated"
             <+> doublePrec 3 (realToFrac alloc / 1024 / 1024)
             <+> text "megabytes")
      which implies time is in milliseconds, and allocations in bytes (which divided by 1024 would be KB, and again would be MB)
  6. 15 Mar, 2020 2 commits
    • Judah Jacobson's avatar
      Add a -no-haddock flag. · c35c545d
      Judah Jacobson authored
      This flag undoes the effect of a previous "-haddock" flag.  Having both flags makes it easier
      for build systems to enable Haddock parsing in a set of global flags, but then disable it locally for
      specific targets (e.g., third-party packages whose comments don't pass the validation in the latest GHC).
      I added the flag to expected-undocumented-flags.txt since `-haddock` was alreadyin that list.
    • Krzysztof Gogolewski's avatar
      Document restriction on SCC pragma syntax · d30aeb4b
      Krzysztof Gogolewski authored
      Currently, the names of cost centres must be quoted or
      be lowercase identifiers.
      Fixes #17916.
  7. 14 Mar, 2020 1 commit
  8. 11 Mar, 2020 1 commit
  9. 29 Feb, 2020 2 commits
  10. 24 Feb, 2020 2 commits
  11. 22 Feb, 2020 1 commit
  12. 21 Feb, 2020 2 commits
  13. 20 Feb, 2020 2 commits
  14. 16 Feb, 2020 1 commit
  15. 14 Feb, 2020 7 commits
  16. 13 Feb, 2020 1 commit
  17. 12 Feb, 2020 2 commits
  18. 11 Feb, 2020 1 commit
  19. 09 Feb, 2020 1 commit
  20. 08 Feb, 2020 2 commits
  21. 01 Feb, 2020 1 commit
    • Ömer Sinan Ağacan's avatar
      Improve/fix -fcatch-bottoms documentation · 859db7d6
      Ömer Sinan Ağacan authored
      Old documentation suggests that -fcatch-bottoms only adds a default
      alternative to bottoming case expression, but that's not true. We use a
      very simplistic "is exhaustive" check and add default alternatives to
      any case expression that does not cover all constructors of the type. In
      case of GADTs this simple check assumes all constructors should be
      covered, even the ones ruled out by the type of the scrutinee.
      Update the documentation to reflect this.
      (Originally noticed in #17648)
      [ci skip]
  22. 25 Jan, 2020 3 commits
    • Sylvain Henry's avatar
    • Ryan Scott's avatar
      Handle local fixity declarations in DsMeta properly · c3fde723
      Ryan Scott authored
      `DsMeta.rep_sig` used to skip over `FixSig` entirely, which had the
      effect of causing local fixity declarations to be dropped when quoted
      in Template Haskell. But there is no good reason for this state of
      affairs, as the code in `DsMeta.repFixD` (which handles top-level
      fixity declarations) handles local fixity declarations just fine.
      This patch factors out the necessary parts of `repFixD` so that they
      can be used in `rep_sig` as well.
      There was one minor complication: the fixity signatures for class
      methods in each `HsGroup` were stored both in `FixSig`s _and_ the
      list of `LFixitySig`s for top-level fixity signatures, so I needed
      to take action to prevent fixity signatures for class methods being
      converted to `Dec`s twice. I tweaked `RnSource.add` to avoid putting
      these fixity signatures in two places and added
      `Note [Top-level fixity signatures in an HsGroup]` in `GHC.Hs.Decls`
      to explain the new design.
      Fixes #17608. Bumps the Haddock submodule.
    • Sebastian Graf's avatar
      PmCheck: Formulate as translation between Clause Trees · 8038cbd9
      Sebastian Graf authored
      We used to check `GrdVec`s arising from multiple clauses and guards in
      isolation. That resulted in a split between `pmCheck` and
      `pmCheckGuards`, the implementations of which were similar, but subtly
      different in detail. Also the throttling mechanism described in
      `Note [Countering exponential blowup]` ultimately got quite complicated
      because it had to cater for both checking functions.
      This patch realises that pattern match checking doesn't just consider
      single guarded RHSs, but that it's always a whole set of clauses, each
      of which can have multiple guarded RHSs in turn. We do so by
      translating a list of `Match`es to a `GrdTree`:
      data GrdTree
        = Rhs !RhsInfo
        | Guard !PmGrd !GrdTree      -- captures lef-to-right  match semantics
        | Sequence !GrdTree !GrdTree -- captures top-to-bottom match semantics
        | Empty                      -- For -XEmptyCase, neutral element of Sequence
      Then we have a function `checkGrdTree` that matches a given `GrdTree`
      against an incoming set of values, represented by `Deltas`:
      checkGrdTree :: GrdTree -> Deltas -> CheckResult
      Throttling is isolated to the `Sequence` case and becomes as easy as one
      would expect: When the union of uncovered values becomes too big, just
      return the original incoming `Deltas` instead (which is always a
      superset of the union, thus a sound approximation).
      The returned `CheckResult` contains two things:
      1. The set of values that were not covered by any of the clauses, for
         exhaustivity warnings.
      2. The `AnnotatedTree` that enriches the syntactic structure of the
         input program with divergence and inaccessibility information.
      This is `AnnotatedTree`:
      data AnnotatedTree
        = AccessibleRhs !RhsInfo
        | InaccessibleRhs !RhsInfo
        | MayDiverge !AnnotatedTree
        | SequenceAnn !AnnotatedTree !AnnotatedTree
        | EmptyAnn
      Crucially, `MayDiverge` asserts that the tree may force diverging
      values, so not all of its wrapped clauses can be redundant.
      While the set of uncovered values can be used to generate the missing
      equations for warning messages, redundant and proper inaccessible
      equations can be extracted from `AnnotatedTree` by
      For this to work properly, the interface to the Oracle had to change.
      There's only `addPmCts` now, which takes a bag of `PmCt`s. There's a
      whole bunch of `PmCt` variants to replace the different oracle functions
      from before.
      The new `AnnotatedTree` structure allows for more accurate warning
      reporting (as evidenced by a number of changes spread throughout GHC's
      code base), thus we fix #17465.
      Fixes #17646 on the go.
      Metric Decrease:
  23. 20 Jan, 2020 2 commits