Skip to content
Snippets Groups Projects
  1. Nov 21, 2024
  2. Aug 17, 2024
    • Mario's avatar
      Implements the Exportable Named Default proposal (#24305) · fa0dbaca
      Mario authored and Mario's avatar Mario committed
      This squashed commit adds support for exportable named defaults, the accepted
      GHC proposal at https://github.com/ghc-proposals/ghc-proposals/pull/409
      
      The proposal extends the Haskell '98 declarations
      
          default (Int, Double)
      
      which were implicitly always applying to Num class alone, to allow specifying
      an arbitrary single-parameter class:
      
          default IsString (Text, String)
      
      The effect of this declaration would be to eliminate the ambiguous type errors
      around string literals when OverloadedStrings extension is active. The
      declaration by itself has effect only in its module, so the proposal also adds
      the ability to export class defaults:
      
          module MyModule (default IsIstring)
      
      Once the language extension is published and established, we can consider using
      it in base and other libraries.
      
      See Note [Named default declarations] in GHC.Tc.Gen.Default
      for implementation details.
      fa0dbaca
  3. Jul 15, 2024
    • sheaf's avatar
      isIrrefutableHsPat: consider COMPLETE pragmas · 572fbc44
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This patch ensures we taken into account COMPLETE pragmas when we
      compute whether a pattern is irrefutable. In particular, if a pattern
      synonym is the sole member of a COMPLETE pragma (without a result TyCon),
      then we consider a pattern match on that pattern synonym to be irrefutable.
      
      This affects the desugaring of do blocks, as it ensures we don't use
      a "fail" operation.
      
      Fixes #15681 #16618 #22004
      572fbc44
  4. Mar 23, 2022
    • Zubin's avatar
      hi haddock: Lex and store haddock docs in interface files · b91798be
      Zubin authored and Marge Bot's avatar Marge Bot committed
      Names appearing in Haddock docstrings are lexed and renamed like any other names
      appearing in the AST. We currently rename names irrespective of the namespace,
      so both type and constructor names corresponding to an identifier will appear in
      the docstring. Haddock will select a given name as the link destination based on
      its own heuristics.
      
      This patch also restricts the limitation of `-haddock` being incompatible with
      `Opt_KeepRawTokenStream`.
      
      The export and documenation structure is now computed in GHC and serialised in
      .hi files. This can be used by haddock to directly generate doc pages without
      reparsing or renaming the source. At the moment the operation of haddock
      is not modified, that's left to a future patch.
      
      Updates the haddock submodule with the minimum changes needed.
      b91798be
  5. Feb 12, 2022
    • Andreas Klebinger's avatar
      Tag inference work. · 0e93023e
      Andreas Klebinger authored and Matthew Pickering's avatar Matthew Pickering committed
      This does three major things:
      * Enforce the invariant that all strict fields must contain tagged
      pointers.
      * Try to predict the tag on bindings in order to omit tag checks.
      * Allows functions to pass arguments unlifted (call-by-value).
      
      The former is "simply" achieved by wrapping any constructor allocations with
      a case which will evaluate the respective strict bindings.
      
      The prediction is done by a new data flow analysis based on the STG
      representation of a program. This also helps us to avoid generating
      redudant cases for the above invariant.
      
      StrictWorkers are created by W/W directly and SpecConstr indirectly.
      See the Note [Strict Worker Ids]
      
      Other minor changes:
      
      * Add StgUtil module containing a few functions needed by, but
        not specific to the tag analysis.
      
      -------------------------
      Metric Decrease:
      	T12545
      	T18698b
      	T18140
      	T18923
              LargeRecord
      Metric Increase:
              LargeRecord
      	ManyAlternatives
      	ManyConstructors
      	T10421
      	T12425
      	T12707
      	T13035
      	T13056
      	T13253
      	T13253-spj
      	T13379
      	T15164
      	T18282
      	T18304
      	T18698a
      	T1969
      	T20049
      	T3294
      	T4801
      	T5321FD
      	T5321Fun
      	T783
      	T9233
      	T9675
      	T9961
      	T19695
      	WWRec
      -------------------------
      0e93023e
  6. Aug 13, 2021
    • Sylvain Henry's avatar
      Refactoring module dependencies · c367b39e
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      * Make mkDependencies pure
      * Use Sets instead of sorted lists
      
      Notable perf changes:
      
            MultiLayerModules(normal) ghc/alloc  4130851520.0  2981473072.0 -27.8%
                       T13719(normal) ghc/alloc  4313296052.0  4151647512.0  -3.7%
      
      Metric Decrease:
          MultiLayerModules
          T13719
      c367b39e
  7. Jun 17, 2021
    • Matthew Pickering's avatar
      profiling: Look in RHS of rules for cost centre ticks · 01fd2617
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There are some obscure situations where the RHS of a rule can contain a
      tick which is not mentioned anywhere else in the program. If this
      happens you end up with an obscure linker error. The solution is quite
      simple, traverse the RHS of rules to also look for ticks. It turned out
      to be easier to implement if the traversal was moved into CoreTidy
      rather than at the start of code generation because there we still had
      easy access to the rules.
      
      ./StreamD.o(.text+0x1b9f2): error: undefined reference to 'StreamK_mkStreamFromStream_HPC_cc'
      ./MArray.o(.text+0xbe83): error: undefined reference to 'StreamK_mkStreamFromStream_HPC_cc'
      Main.o(.text+0x6fdb): error: undefined reference to 'StreamK_mkStreamFromStream_HPC_cc'
      01fd2617
  8. Jun 03, 2021
    • Matthew Pickering's avatar
      Driver Rework Patch · 25977ab5
      Matthew Pickering authored
      This patch comprises of four different but closely related ideas. The
      net result is fixing a large number of open issues with the driver
      whilst making it simpler to understand.
      
      1. Use the hash of the source file to determine whether the source file
      has changed or not. This makes the recompilation checking more robust to
      modern build systems which are liable to copy files around changing
      their modification times.
      
      2. Remove the concept of a "stable module", a stable module was one
      where the object file was older than the source file, and all transitive
      dependencies were also stable. Now we don't rely on the modification
      time of the source file, the notion of stability is moot.
      
      3. Fix TH/plugin recompilation after the removal of stable modules. The
      TH recompilation check used to rely on stable modules. Now there is a
      uniform and simple way, we directly track the linkables which were
      loaded into the interpreter whilst compiling a module. This is an
      over-approximation but more robust wrt package dependencies changing.
      
      4. Fix recompilation checking for dynamic object files. Now we actually
      check if the dynamic object file exists when compiling with -dynamic-too
      
      Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093
      25977ab5
  9. Nov 03, 2020
  10. Oct 29, 2020
    • Sylvain Henry's avatar
      Split GHC.Driver.Types · 0e9f6def
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      I was working on making DynFlags stateless (#17957), especially by
      storing loaded plugins into HscEnv instead of DynFlags. It turned out to
      be complicated because HscEnv is in GHC.Driver.Types but LoadedPlugin
      isn't: it is in GHC.Driver.Plugins which depends on GHC.Driver.Types. I
      didn't feel like introducing yet another hs-boot file to break the loop.
      
      Additionally I remember that while we introduced the module hierarchy
      (#13009) we talked about splitting GHC.Driver.Types because it contained
      various unrelated types and functions, but we never executed. I didn't
      feel like making GHC.Driver.Types bigger with more unrelated Plugins
      related types, so finally I bit the bullet and split GHC.Driver.Types.
      
      As a consequence this patch moves a lot of things. I've tried to put
      them into appropriate modules but nothing is set in stone.
      
      Several other things moved to avoid loops.
      
      * Removed Binary instances from GHC.Utils.Binary for random compiler
        things
      * Moved Typeable Binary instances into GHC.Utils.Binary.Typeable: they
        import a lot of things that users of GHC.Utils.Binary don't want to
        depend on.
      * put everything related to Units/Modules under GHC.Unit:
        GHC.Unit.Finder, GHC.Unit.Module.{ModGuts,ModIface,Deps,etc.}
      * Created several modules under GHC.Types: GHC.Types.Fixity, SourceText,
        etc.
      * Split GHC.Utils.Error (into GHC.Types.Error)
      * Finally removed GHC.Driver.Types
      
      Note that this patch doesn't put loaded plugins into HscEnv. It's left
      for another patch.
      
      Bump haddock submodule
      0e9f6def
Loading