summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* Rename the singleton tuple GHC.Tuple.Unit to GHC.Tuple.SoloTom Ellis2020-06-013-3/+5
|
* Clean up file paths for new module hierarchyTakenobu Tani2020-06-016-9/+9
| | | | | | | | | This updates comments only. This patch replaces file references according to new module hierarchy. See also: * https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular * https://gitlab.haskell.org/ghc/ghc/issues/13009
* Apply suggestion to libraries/base/GHC/Exts.hsBodigrim2020-06-011-1/+1
|
* Clarify description of fromListNBodigrim2020-06-011-5/+6
|
* base: Scrap deprecation plan for Data.Monoid.{First,Last}Simon Jakobi2020-05-292-20/+3
| | | | | | See the discussion on the libraries mailing list for context: https://mail.haskell.org/pipermail/libraries/2020-April/030357.html
* Fix "build/elem" RULE.Andreas Klebinger2020-05-299-44/+266
| | | | | | | | | | | | | | | | | | | | | | | | An redundant constraint prevented the rule from matching. Fixing this allows a call to elem on a known list to be translated into a series of equality checks, and eventually a simple case expression. Surprisingly this seems to regress elem for strings. To avoid this we now also allow foldrCString to inline and add an UTF8 variant. This results in elem being compiled to a tight non-allocating loop over the primitive string literal which performs a linear search. In the process this commit adds UTF8 variants for some of the functions in GHC.CString. This is required to make this work for both ASCII and UTF8 strings. There are also small tweaks to the CString related rules. We now allow ourselfes the luxury to compare the folding function via eqExpr, which helps to ensure the rule fires before we inline foldrCString*. Together with a few changes to allow matching on both the UTF8 and ASCII variants of the CString functions.
* Add Semigroup/Monoid for Q (#18123)Vladislav Zavialov2020-05-282-0/+11
|
* Revert "Specify kind variables for inferred kinds in base."Ben Gamari2020-05-2514-167/+70
| | | | | | | | As noted in !3132, this has rather severe knock-on consequences in user-code. We'll need to revisit this before merging something along these lines. This reverts commit 9749fe1223d182b1f8e7e4f7378df661c509f396.
* Bump process submoduleBen Gamari2020-05-231-0/+0
| | | | Fixes #17926.
* Implement cstringLength# and FinalPtrAndrew Martin2020-05-234-20/+205
| | | | | | | | | | | | | | | | | | | | This function and its accompanying rule resolve issue #5218. A future PR to the bytestring library will make the internal Data.ByteString.Internal.unsafePackAddress compute string length with cstringLength#. This will improve the status quo because it is eligible for constant folding. Additionally, introduce a new data constructor to ForeignPtrContents named FinalPtr. This additional data constructor, when used in the IsString instance for ByteString, leads to more Core-to-Core optimization opportunities, fewer runtime allocations, and smaller binaries. Also, this commit re-exports all the functions from GHC.CString (including cstringLength#) in GHC.Exts. It also adds a new test driver. This test driver is used to perform substring matches on Core that is dumped after all the simplifier passes. In this commit, it is used to check that constant folding of cstringLength# works.
* Make `Int`'s `mod` and `rem` strict in their first argumentsSebastian Graf2020-05-211-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | They used to be strict until 4d2ac2d (9 years ago). It's obviously better to be strict for performance reasons. It also blocks #18067. NoFib results: ``` -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- integer -1.1% +0.4% wheel-sieve2 +21.2% +20.7% -------------------------------------------------------------------------------- Min -1.1% -0.0% Max +21.2% +20.7% Geometric Mean +0.2% +0.2% ``` The regression in `wheel-sieve2` is due to reboxing that likely will go away with the resolution of #18067. See !3282 for details. Fixes #18187.
* Document INLINE(ABLE) pragmas that enable fusionbuggymcbugfix2020-05-211-3/+21
|
* Piggyback on Enum Word methods for Word64buggymcbugfix2020-05-211-4/+38
| | | | | If we are on a 64 bit platform, we can use the efficient Enum Word methods for the Enum Word64 instance.
* Add INLINABLE pragmas to Enum list producersbuggymcbugfix2020-05-211-5/+30
| | | | | | | The INLINABLE pragmas ensure that we export stable (unoptimised) unfoldings in the interface file so we can do list fusion at usage sites. Related tickets: #15185, #8763, #18178.
* Fix spelling mistakes and typosbuggymcbugfix2020-05-211-2/+2
|
* Explicit SpecificityGert-Jan Bottu2020-05-217-61/+102
| | | | | | | | | | | | | | | | | | | | Implementation for Ticket #16393. Explicit specificity allows users to manually create inferred type variables, by marking them with braces. This way, the user determines which variables can be instantiated through visible type application. The additional syntax is included in the parser, allowing users to write braces in type variable binders (type signatures, data constructors etc). This information is passed along through the renamer and verified in the type checker. The AST for type variable binders, data constructors, pattern synonyms, partial signatures and Template Haskell has been updated to include the specificity of type variables. Minor notes: - Bumps haddock submodule - Disables pattern match checking in GHC.Iface.Type with GHC 8.8
* base: Add Generic instances to various datatypes under GHC.*Fumiaki Kinoshita2020-05-215-0/+39
| | | | | | | | | | | | * GHC.Fingerprint.Types: Fingerprint * GHC.RTS.Flags: GiveGCStats, GCFlags, ConcFlags, DebugFlags, CCFlags, DoHeapProfile, ProfFlags, DoTrace, TraceFlags, TickyFlags, ParFlags and RTSFlags * GHC.Stats: RTSStats and GCStats * GHC.ByteOrder: ByteOrder * GHC.Unicode: GeneralCategory * GHC.Stack.Types: SrcLoc Metric Increase: haddock.base
* Predicate, Equivalence derive via `.. -> a -> All'Baldur Blöndal2020-05-131-36/+132
|
* docs: Add examples for Data.Semigroup.Arg{Min,Max}Simon Jakobi2020-05-131-0/+7
| | | | Context: #17153
* rts/CNF: Fix fixup comparison functionBen Gamari2020-05-133-0/+28
| | | | | | | Previously we would implicitly convert the difference between two words to an int, resulting in an integer overflow on 64-bit machines. Fixes #16992
* Fix unboxed-sums GC ptr-slot rubbish value (#17791)Sylvain Henry2020-05-093-5/+47
| | | | | | | This patch allows boot libraries to use unboxed sums without implicitly depending on `base` package because of `absentSumFieldError`. See updated Note [aBSENT_SUM_FIELD_ERROR_ID] in GHC.Core.Make
* Bump exceptions submodule so that dist-boot is .gitignore'dRyan Scott2020-05-081-0/+0
| | | | | | | | | | | | | `exceptions` is a stage-0 boot library as of commit 30272412fa437ab8e7a8035db94a278e10513413, which means that building `exceptions` in a GHC tree will generate a `dist-boot` directory. However, this directory was not specified in `exceptions`' `.gitignore` file, which causes it to dirty up the current `git` working directory. Accordingly, this bumps the `exceptions` submodule to commit ghc/packages/exceptions@23c0b8a50d7592af37ca09beeec16b93080df98f, which adds `dist-boot` to the `.gitignore` file.
* Apply more suggestions from Simon JakobiJoseph C. Sible2020-05-081-4/+4
|
* Apply suggestion to libraries/base/Data/Monoid.hsJoseph C. Sible2020-05-081-1/+1
|
* Document lawlessness of Ap's Num instanceJoseph C. Sible2020-05-081-0/+26
|
* Specify kind variables for inferred kinds in base.Baldur Blöndal2020-05-0814-70/+167
|
* doc (Bitraversable): Add examples to BitraversableJulien Debon2020-05-082-3/+68
| | | | | | | | * Add examples to Data.Bitraversable * Fix formatting for (,) in Bitraversable and Bifoldable * Fix mistake on bimapAccumR documentation See #17929
* Add doc examples for BifoldableJulien Debon2020-05-081-7/+581
| | | | See #17929
* Move LeadingUnderscore into Platform (#17957)Sylvain Henry2020-05-062-10/+12
| | | | | Avoid direct use of DynFlags to know if symbols must be prefixed by an underscore.
* Remove SpecConstrAnnotation (#13681)Sylvain Henry2020-05-051-23/+2
| | | | | | | | | This has been deprecated since 2013. Use GHC.Types.SPEC instead. Make GHC.Exts "not-home" for haddock Metric Decrease: haddock.base
* Unit: split and rename modulesSylvain Henry2020-04-302-5/+5
| | | | | | | Introduce GHC.Unit.* hierarchy for everything concerning units, packages and modules. Update Haddock submodule
* Factorize mungePackagePaths codeSylvain Henry2020-04-301-1/+73
| | | | | | | | This patch factorizes the duplicated code used in ghc-pkg and in GHC to munge package paths/urls. It also fixes haddock-html munging in GHC (allowed to be either a file or a url) to mimic ghc-pkg behavior.
* Refactor UnitInfo load/store from databasesSylvain Henry2020-04-301-124/+101
| | | | | | | | | | | Converting between UnitInfo stored in package databases and UnitInfo as they are used in ghc-pkg and ghc was done in a very convoluted way (via BinaryStringRep and DbUnitModuleRep type classes using fun deps, etc.). It was difficult to understand and even more to modify (I wanted to try to use a GADT for UnitId but fun deps got in the way). The new code uses much more straightforward functions to convert between the different representations. Much simpler.
* Remove unused `emptyGenericUnitInfo`Sylvain Henry2020-04-301-36/+0
|
* Refactor UnitInfoSylvain Henry2020-04-301-178/+289
| | | | | | | | | | | | | | | | | | | | | * Rename InstalledPackageInfo into GenericUnitInfo The name InstalledPackageInfo is only kept for alleged backward compatibility reason in Cabal. ghc-boot has its own stripped down copy of this datatype but it doesn't need to keep the name. Internally we already use type aliases (UnitInfo in GHC, PackageCacheFormat in ghc-pkg). * Rename UnitInfo fields: add "unit" prefix and fix misleading names * Add comments on every UnitInfo field * Rename SourcePackageId into PackageId "Package" already indicates that it's a "source package". Installed package components are called units. Update Haddock submodule
* Define a Quote IO instanceRyan Scott2020-04-281-2/+8
| | | | Fixes #18103.
* TH: fix Show/Eq/Ord instances for Bytes (#16457)Sylvain Henry2020-04-272-1/+48
| | | | We shouldn't compare pointer values but the actual bytes.
* Fix misleading Ptr phantom type in SerializedCompact (#15653)Sylvain Henry2020-04-261-2/+2
|
* Do eager instantation in termsSimon Peyton Jones2020-04-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements eager instantiation, a small but critical change to the type inference engine, #17173. The main change is this: When inferring types, always return an instantiated type (for now, deeply instantiated; in future shallowly instantiated) There is more discussion in https://www.tweag.io/posts/2020-04-02-lazy-eager-instantiation.html There is quite a bit of refactoring in this patch: * The ir_inst field of GHC.Tc.Utils.TcType.InferResultk has entirely gone. So tcInferInst and tcInferNoInst have collapsed into tcInfer. * Type inference of applications, via tcInferApp and tcInferAppHead, are substantially refactored, preparing the way for Quick Look impredicativity. * New pure function GHC.Tc.Gen.Expr.collectHsArgs and applyHsArgs are beatifully dual. We can see the zipper! * GHC.Tc.Gen.Expr.tcArgs is now much nicer; no longer needs to return a wrapper * In HsExpr, HsTypeApp now contains the the actual type argument, and is used in desugaring, rather than putting it in a mysterious wrapper. * I struggled a bit with good error reporting in Unify.matchActualFunTysPart. It's a little bit simpler than before, but still not great. Some smaller things * Rename tcPolyExpr --> tcCheckExpr tcMonoExpr --> tcLExpr * tcPatSig moves from GHC.Tc.Gen.HsType to GHC.Tc.Gen.Pat Metric Decrease: T9961 Reduction of 1.6% in comiler allocation on T9961, I think.
* Mark DataCon wrappers CONLIKEAlexis King2020-04-221-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Now that DataCon wrappers don’t inline until phase 0 (see commit b78cc64e923716ac0512c299f42d4d0012306c05), it’s important that case-of-known-constructor and RULE matching be able to see saturated applications of DataCon wrappers in unfoldings. Making them conlike is a natural way to do it, since they are, in fact, precisely the sort of thing the CONLIKE pragma exists to solve. Fixes #18012. This also bumps the version of the parsec submodule to incorporate a patch that avoids a metric increase on the haddock perf tests. The increase was not really a flaw in this patch, as parsec was implicitly relying on inlining heuristics. The patch to parsec just adds some INLINABLE pragmas, and we get a nice performance bump out of it (well beyond the performance we lost from this patch). Metric Decrease: T12234 WWRec haddock.Cabal haddock.base haddock.compiler
* CmmToAsm DynFlags refactoring (#17957)Sylvain Henry2020-04-211-31/+53
| | | | | | | | | | | | | * Remove `DynFlags` parameter from `isDynLinkName`: `isDynLinkName` used to test the global `ExternalDynamicRefs` flag. Now we test it outside of `isDynLinkName` * Add new fields into `NCGConfig`: current unit id, sse/bmi versions, externalDynamicRefs, etc. * Replace many uses of `DynFlags` by `NCGConfig` * Moved `BMI/SSE` datatypes into `GHC.Platform`
* Mark T12010 fragile on 32-bitÖmer Sinan Ağacan2020-04-201-5/+5
|
* Derive Ord instance for ExtensionShayne Fletcher2020-04-201-0/+4
| | | | | | Metric Increase: T12150 T12234
* Modules (#13009)Sylvain Henry2020-04-1810-30/+33
| | | | | | | | | | | | | | * SysTools * Parser * GHC.Builtin * GHC.Iface.Recomp * Settings Update Haddock submodule Metric Decrease: Naperian parsing001
* GHC.Core.Opt renamingSylvain Henry2020-04-184-8/+8
| | | | | | | | | | | * GHC.Core.Op => GHC.Core.Opt * GHC.Core.Opt.Simplify.Driver => GHC.Core.Opt.Driver * GHC.Core.Opt.Tidy => GHC.Core.Tidy * GHC.Core.Opt.WorkWrap.Lib => GHC.Core.Opt.WorkWrap.Utils As discussed in: * https://mail.haskell.org/pipermail/ghc-devs/2020-April/018758.html * https://gitlab.haskell.org/ghc/ghc/issues/13009#note_264650
* Improve prepForeignCall error reportingÖmer Sinan Ağacan2020-04-181-9/+21
| | | | | | | Show parameters and description of the error code when ffi_prep_cif fails. This may be helpful for debugging #17018.
* Bump template-haskell version to 2.17.0.0Ryan Scott2020-04-144-2/+2
| | | | | | | | | | | | | | | | | | This requires bumping the `exceptions` and `text` submodules to bring in commits that bump their respective upper version bounds on `template-haskell`. Fixes #17645. Fixes #17696. Note that the new `text` commit includes a fair number of additions to the Haddocks in that library. As a result, Haddock has to do more work during the `haddock.Cabal` test case, increasing the number of allocations it requires. Therefore, ------------------------- Metric Increase: haddock.Cabal -------------------------
* base: Enable large file support for OFD locking impl.Ben Gamari2020-04-141-0/+3
| | | | | Not only is this a good idea in general but this should also avoid issue #17950 by ensuring that off_t is 64-bits.
* doc (Foldable): Add examples to Data.FoldableJulien Debon2020-04-141-3/+470
| | | | See #17929
* Add an INLINE pragma to Control.Category.>>>Alexis King2020-04-122-4/+68
| | | | | | | This fixes #18013 by adding INLINE pragmas to both Control.Category.>>> and GHC.Desugar.>>>. The functional change in this patch is tiny (just two lines of pragmas!), but an accompanying Note explains in gory detail what’s going on.