summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
...
* Drop O(n^2) warning on concatViktor Dukhovni2021-12-091-3/+0
|
* A few more typosViktor Dukhovni2021-12-091-6/+7
|
* Fix typo and outdated link in Data.FoldableViktor Dukhovni2021-12-092-3/+4
| | | | | | | | Amazing nobody had reported the "Foldabla" typo. :-( The Traversable docs got overhauled, leaving a stale link in Foldable to a section that got replaced. Gave the new section an anchor and updated the link.
* Bump bytestring submodule to 0.11.2.0Bodigrim2021-12-091-0/+0
| | | | | | | | Both tests import `Data.ByteString`, so the change in allocations is more or less expected. Metric Increase: T19695 T9630
* Re-export GHC.Types from GHC.Extssheaf2021-12-073-56/+62
| | | | | | | | | | | | | | Several times in the past, it has happened that things from GHC.Types were not re-exported from GHC.Exts, forcing users to import either GHC.Types or GHC.Prim, which are subject to internal change without notice. We now re-export GHC.Types from GHC.Exts, which should avoid this happening again in the future. In particular, we now re-export `Multiplicity` and `MultMul`, which we didn't before. Fixes #20695
* Use italic big-O notation in Data.FoldableViktor Dukhovni2021-12-071-18/+18
|
* More specific documentation of foldr' caveatsViktor Dukhovni2021-12-071-3/+17
|
* List-monomorphic `foldr'`Viktor Dukhovni2021-12-072-10/+44
| | | | | | | | | | | | | While a *strict* (i.e. constant space) right-fold on lists is not possible, the default `foldr'` is optimised for structures like `Seq`, that support efficient access to the right-most elements. The original default implementation seems to have a better constant factor for lists, so we add a monomorphic implementation in GHC.List. Should this be re-exported from `Data.List`? That would be a user-visible change if both `Data.Foldable` and `Data.List` are imported unqualified...
* Revert "Data.List specialization to []"Matthew Pickering2021-12-0317-1409/+1633
| | | | | | | | | | This reverts commit bddecda1a4c96da21e3f5211743ce5e4c78793a2. This implements the first step in the plan formulated in #20025 to improve the communication and migration strategy for the proposed changes to Data.List. Requires changing the haddock submodule to update the test output.
* Make openFile more tolerant of async excs (#18832)Kamil Dworakowski2021-12-025-45/+96
|
* ghc-compact: Update cabal fileBen Gamari2021-12-011-2/+5
| | | | Improve documentation, bump bounds and cabal-version.
* Rename Data.Array.ByteArray -> Data.Array.ByteBodigrim2021-11-263-8/+8
|
* Rename Data.ByteArray to Data.Array.ByteArray + add TrustworthyBodigrim2021-11-263-8/+9
|
* Add Data.Bits changes to base 4.16 changelogsheaf2021-11-251-0/+16
| | | | | | | | | | Several additions since 4.15 had not been recorded in the changelog: - newtypes And, Ior, Xor and Iff, - oneBits - symbolic synonyms `.^.`, `.>>.`, `!>>.`, `.<<.` and `!<<.`. Fixes #20608.
* Use getExecutablePath in getBaseDir on OpenBSDGreg Steuck2021-11-251-2/+2
| | | | | | | | While OpenBSD doesn't have a general mechanism for determining the path of the executing program image, it is reasonable to rely on argv[0] which happens as a fallback in getExecutablePath. With this change on top of T18173 we can get a bit close to fixing #18173.
* Make INLINE/NOINLINE pragmas a bgi less constrainingSimon Peyton Jones2021-11-226-53/+75
| | | | | | | | We can inline a bit earlier than the previous pragmas said. I think they dated from an era in which the InitialPhase did no inlining. I don't think this patch will have much effect, but it's a bit cleaner.
* Use 'NonEmpty' for the fields in an 'HsProjection' (#20389)Zubin Duggal2021-11-203-3/+5
| | | | | | | | | | | | T12545 is very inconsistently affected by this change for some reason. There is a decrease in allocations on most configurations, but an increase on validate-x86_64-linux-deb9-unreg-hadrian. Accepting it as it seems unrelated to this patch. Metric Decrease: T12545 Metric Increase: T12545
* Bump deepseq submodule to 1.4.7.0-preBen Gamari2021-11-201-0/+0
| | | | Addresses #20653.
* Bump text and parsec submodulesBen Gamari2021-11-182-0/+0
| | | | | | | Accommodates text-2.0. Metric Decrease: T15578
* Bump Cabal submoduleBen Gamari2021-11-182-1/+1
|
* Revert "base: Use one-shot kqueue on macOS"Matthew Pickering2021-11-181-2/+15
| | | This reverts commit 41117d71bb58e001f6a2b6a11c9314d5b70b9182
* bitReverse functions in GHC.Word are since base-4.14.0.0, not 4.12.0.0ARATA Mizuki2021-11-171-4/+4
| | | | They were added in 33173a51c77d9960d5009576ad9b67b646dfda3c, which constitutes GHC 8.10.1 / base-4.14.0.0
* Provide in-line kind signatures for Data.Type.Ord.Compare.Andrew Pritchard2021-11-171-1/+1
| | | | | | Haddock doesn't know how to render SAKS, so the only current way to make the documentation show the kind is to write what it should say into the type family declaration.
* Fix Haddock markup on Data.Type.Ord.OrdCond.Andrew Pritchard2021-11-171-3/+4
|
* Increase type sharingBen Gamari2021-11-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #20541 by making mkTyConApp do more sharing of types. In particular, replace * BoxedRep Lifted ==> LiftedRep * BoxedRep Unlifted ==> UnliftedRep * TupleRep '[] ==> ZeroBitRep * TYPE ZeroBitRep ==> ZeroBitType In each case, the thing on the right is a type synonym for the thing on the left, declared in ghc-prim:GHC.Types. See Note [Using synonyms to compress types] in GHC.Core.Type. The synonyms for ZeroBitRep and ZeroBitType are new, but absolutely in the same spirit as the other ones. (These synonyms are mainly for internal use, though the programmer can use them too.) I also renamed GHC.Core.Ty.Rep.isVoidTy to isZeroBitTy, to be compatible with the "zero-bit" nomenclature above. See discussion on !6806. There is a tricky wrinkle: see GHC.Core.Types Note [Care using synonyms to compress types] Compiler allocation decreases by up to 0.8%.
* Hadrian: fix windows cross-build (#20657)Sylvain Henry2021-11-154-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many small things to fix: * Hadrian: platform triple is "x86_64-w64-mingw32" and this wasn't recognized by Hadrian (note "w64" instead of "unknown") * Hadrian was using the build platform ("isWindowsHost") to detect the use of the Windows toolchain, which was wrong. We now use the "targetOs" setting. * Hadrian was doing the same thing for Darwin so we fixed both at once, even if cross-compilation to Darwin is unlikely to happen afaik (cf "osxHost" vs "osxTarget" changes) * Hadrian: libffi name was computed in two different places and one of them wasn't taking the different naming on Windows into account. * Hadrian was passing "-Irts/include" when building the stage1 compiler leading to the same error as in #18143 (which is using make). stage1's RTS is stage0's one so mustn't do this. * Hadrian: Windows linker doesn't seem to support "-zorigin" so we don't pass it (similarly to Darwin) * Hadrian: hsc2hs in cross-compilation mode uses a trick (taken from autoconf): it defines "static int test_array[SOME_EXPR]" where SOME_EXPR is a constant expression. However GCC reports an error because SOME_EXPR is supposedly not constant. This is fixed by using another method enabled with the `--via-asm` flag of hsc2hs. It has been fixed in `make` build system (5f6fcf7808b16d066ad0fb2068225b3f2e8363f7) but not in Hadrian. * Hadrian: some packages are specifically built only on Windows but they shouldn't be when building a cross-compiler (`touchy` and `ghci-wrapper`). We now correctly detect this case and disable these packages. * Base: we use `iNVALID_HANDLE_VALUE` in a few places. It fixed some hsc2hs issues before we switched to `--via-asm` (see above). I've kept these changes are they make the code nicer. * Base: `base`'s configure tries to detect if it is building for Windows but for some reason the `$host_alias` value is `x86_64-windows` in my case and it wasn't properly detected. * Base: libraries/base/include/winio_structs.h imported "Windows.h" with a leading uppercase. It doesn't work on case-sensitive systems when cross-compiling so we have to use "windows.h". * RTS: rts/win32/ThrIOManager.c was importin "rts\OSThreads.h" but this path isn't valid when cross-compiling. We replaced "\" with "/". * DeriveConstants: this tool derives the constants from the target RTS header files. However these header files define `StgAsyncIOResult` only when `mingw32_HOST_OS` is set hence it seems we have to set it explicitly. Note that deriveConstants is called more than once (why? there is only one target for now so it shouldn't) and in the second case this value is correctly defined (probably coming indirectly from the import of "rts/PosixSource.h"). A better fix would probably be to disable the unneeded first run of deriveconstants.
* Implement -Wforall-identifier (#20609)Vladislav Zavialov2021-11-121-3/+3
| | | | | | | | | | In accordance with GHC Proposal #281 "Visible forall in types of terms": For three releases before this change takes place, include a new warning -Wforall-identifier in -Wdefault. This warning will be triggered at definition sites (but not use sites) of forall as an identifier. Updates the haddock submodule.
* Improve ZipList section of Traversable overviewViktor Dukhovni2021-11-101-6/+15
| | | | | | | | - Fix cut/paste error by adding missing `c` pattern in `Vec3` traversable instance. - Add a bit of contextual prose above the Vec2/Vec3 instance sample code.
* Fix rendering of Applicative lawLi-yao Xia2021-11-101-1/+1
|
* Bignum: expose backendName (#20495)Sylvain Henry2021-11-096-1/+25
|
* Fix Int64/Word64's Enum instance fusionSylvain Henry2021-11-062-0/+28
| | | | | | | | Performance improvement: T15185(normal) run/alloc 51112.0 41032.0 -19.7% GOOD Metric Decrease: T15185
* Make Word64 use Word64# on every architectureSylvain Henry2021-11-0610-456/+43
|
* Remove target dependent CPP for Word64/Int64 (#11470)Sylvain Henry2021-11-066-36/+53
| | | | | | | | | | | | | | | | | | | | | | | | | Primops types were dependent on the target word-size at *compiler* compilation time. It's an issue for multi-target as GHC may not have the correct primops types for the target. This patch fixes some primops types: if they take or return fixed 64-bit values they now always use `Int64#/Word64#`, even on 64-bit architectures (where they used `Int#/Word#` before). Users of these primops may now need to convert from Int64#/Word64# to Int#/Word# (a no-op at runtime). This is a stripped down version of !3658 which goes the all way of changing the underlying primitive types of Word64/Int64. This is left for future work. T12545 allocations increase ~4% on some CI platforms and decrease ~3% on AArch64. Metric Increase: T12545 Metric Decrease: T12545
* Avoid GHC_STAGE and other include bitsJohn Ericson2021-11-051-1/+1
| | | | | | | | | We should strive to make our includes in terms of the RTS as much as possible. One place there that is not possible, the llvm version, we make a new tiny header Stage numbers are somewhat arbitrary, if we simple need a newer RTS, we should say so.
* Remove record field from SoloSimon Peyton Jones2021-11-055-33/+11
| | | | | | | | | | | | | | Ticket #20562 revealed that Solo, which is a wired-in TyCon, had a record field that wasn't being added to the type env. Why not? Because wired-in TyCons don't have record fields. It's not hard to change that, but it's tiresome for this one use-case, and it seems easier simply to make `getSolo` into a standalone function. On the way I refactored the handling of Solo slightly, to put it into wiredInTyCons (where it belongs) rather than only in knownKeyNames
* Bignum: add missing ruleSylvain Henry2021-10-291-0/+3
| | | | Add missing "Natural -> Integer -> Word#" rule.
* Add more INLINABLE and INLINE pragmas to `Enum Int*` instancesSebastian Graf2021-10-293-4/+64
| | | | | Otherwise the instances aren't good list producers. See Note [Stable Unfolding for list producers].
* base: Note export of Data.Tuple.Solo in changelogBen Gamari2021-10-271-1/+4
|
* Tweak descriptions of lines and unlinesViktor Dukhovni2021-10-251-19/+17
| | | | | It seems more clear to think of lines as LF-terminated rather than LF-separated.
* undefined: Neater CallStack in error messageJoachim Breitner2021-10-241-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Users of `undefined` don’t want to see ``` files.hs: Prelude.undefined: CallStack (from HasCallStack): error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined, called at file.hs:151:19 in main:Main ``` but want to see ``` files.hs: Prelude.undefined: CallStack (from HasCallStack): undefined, called at file.hs:151:19 in main:Main ``` so let’s make that so. The function for that is `withFrozenCallStack`, but that is not usable here (module dependencies, and also not representation-polymorphic). And even if it were, it could confuse GHC’s strictness analyzer, leading to big regressions in some perf tests (T10421 in particular). So after shuffling modules and definitions around, I eventually noticed that the easiest way is to just not call `error` here. Fixes #19886
* Remove IndefiniteSylvain Henry2021-10-221-9/+10
| | | | We no longer need it after previous IndefUnitId refactoring.
* Bignum: allow Integer's signum to inline (#20361)Sylvain Henry2021-10-201-2/+0
| | | | | | | | Allow T12545 to increase because it only happens on CI with dwarf enabled and probably not related to this patch. Metric Increase: T12545
* Bignum: allow Integer predicates to inline (#20361)Sylvain Henry2021-10-201-32/+22
| | | | | | | | | T17516 allocations increase by 48% because Integer's predicates are inlined in some Ord instance methods. These methods become too big to be inlined while they probably should: this is tracked in #20516. Metric Increase: T17516
* Bignum: constant folding for bigNatCompareWord# (#20361)Sylvain Henry2021-10-201-0/+1
|
* Fix infelicities in docs for lines, unlines, words, unwordsKoz Ross2021-10-191-13/+45
|
* Introduce Concrete# for representation polymorphism checkssheaf2021-10-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PHASE 1: we never rewrite Concrete# evidence. This patch migrates all the representation polymorphism checks to the typechecker, using a new constraint form Concrete# :: forall k. k -> TupleRep '[] Whenever a type `ty` must be representation-polymorphic (e.g. it is the type of an argument to a function), we emit a new `Concrete# ty` Wanted constraint. If this constraint goes unsolved, we report a representation-polymorphism error to the user. The 'FRROrigin' datatype keeps track of the context of the representation-polymorphism check, for more informative error messages. This paves the way for further improvements, such as allowing type families in RuntimeReps and improving the soundness of typed Template Haskell. This is left as future work (PHASE 2). fixes #17907 #20277 #20330 #20423 #20426 updates haddock submodule ------------------------- Metric Decrease: T5642 -------------------------
* Insert warnings in the documentation of dangerous functionsTom Sydney Kerckhove2021-10-158-2/+76
|
* Bignum: transfer NOINLINE from Natural to BigNatSylvain Henry2021-10-072-4/+9
|
* Bignum: allow naturalToWordClamp/Negate/Signum to inline (#20361)Sylvain Henry2021-10-071-6/+0
| | | | | We don't need built-in rules now that bignum literals (e.g. 123 :: Natural) match with their constructors (e.g. NS 123##).
* Bignum: allow inlining of naturalEq/Ne/Gt/Lt/Ge/Le/Compare (#20361)Sylvain Henry2021-10-073-5/+15
| | | | | | | | | | Perform constant folding on bigNatCompare instead. Some functions of the Enum class for Natural now need to be inlined explicitly to be specialized at call sites (because `x > lim` for Natural is inlined and the resulting function is a little too big to inline). If we don't do this, T17499 runtime allocations regresses by 16%.