summaryrefslogtreecommitdiff
path: root/libraries/base/GHC
Commit message (Collapse)AuthorAgeFilesLines
* Extend documentation for Data.IORefBodigrim2022-11-201-3/+34
|
* Fix fragile RULE setup in GHC.FloatSimon Peyton Jones2022-11-111-2/+23
| | | | | | | | | | | | | | | In testing my type-vs-constraint patch I found that the handling of Natural literals was very fragile -- and I somehow tripped that fragility in my work. So this patch fixes the fragility. See Note [realToFrac natural-to-float] This made a big (9%) difference in one existing test in perf/should_run/T1-359 Metric Decrease: T10359
* base: avoid using unsupported posix functionality on wasm32Cheng Shao2022-11-113-0/+34
| | | | | This base patch avoids using unsupported posix functionality on wasm32.
* Make indexError work betterSimon Peyton Jones2022-11-101-3/+21
| | | | | | | | | | | | | | | The problem here is described at some length in Note [Boxity for bottoming functions] and Note [Reboxed crud for bottoming calls] in GHC.Core.Opt.DmdAnal. This patch adds a SPECIALISE pragma for indexError, which makes it much less vulnerable to the problem described in these Notes. (This came up in another line of work, where a small change made indexError do reboxing (in nofib/spectral/simple/table_sort) that didn't happen before my change. I've opened #22404 to document the fagility.
* Fire RULES in the SpecialiserSimon Peyton Jones2022-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Specialiser has, for some time, fires class-op RULES in the specialiser itself: see Note [Specialisation modulo dictionary selectors] This MR beefs it up a bit, so that it fires /all/ RULES in the specialiser, not just class-op rules. See Note [Fire rules in the specialiser] The result is a bit more specialisation; see test simplCore/should_compile/T21851_2 This pushed me into a bit of refactoring. I made a new data types GHC.Core.Rules.RuleEnv, which combines - the several source of rules (local, home-package, external) - the orphan-module dependencies in a single record for `getRules` to consult. That drove a bunch of follow-on refactoring, including allowing me to remove cr_visible_orphan_mods from the CoreReader data type. I moved some of the RuleBase/RuleEnv stuff into GHC.Core.Rule. The reorganisation in the Simplifier improve compile times a bit (geom mean -0.1%), but T9961 is an outlier Metric Decrease: T9961
* Document what Alternative/MonadPlus instances actually doJade Lovelace2022-11-082-8/+26
|
* Add example for (<$)Jade Lovelace2022-11-081-0/+9
|
* Fix haddocks for GHC.IORefBodigrim2022-11-031-2/+2
|
* Start the deprecation process for GHC.PackHécate Moonlight2022-10-281-0/+5
|
* Fix broken link to `async` packageEvan Relf2022-10-271-1/+1
|
* Build System: Remove out-of-date comment about make build systemMatthew Pickering2022-10-181-4/+0
| | | | | | | | Both make and hadrian interleave compilation of modules of different modules and don't respect the package boundaries. Therefore I just remove this comment which points out this "difference". Fixes #22253
* Add standard Unicode case predicates isUpperCase and isLowerCase.Pierre Le Marre2022-10-142-2/+88
| | | | | | | | These predicates use the standard Unicode case properties and are more intuitive than isUpper and isLower. Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/90#issuecomment-1276649403. Fixes #14589
* winio: do not re-translate input when handle is uncookedTamar Christina2022-10-121-22/+32
|
* Separate IPE source file from spanBen Gamari2022-10-112-11/+20
| | | | | | The source file name can very often be shared across many IPE entries whereas the source coordinates are generally unique. Separate the two to exploit sharing of the former.
* base: Move IPE helpers to GHC.InfoProvBen Gamari2022-10-113-75/+105
|
* base: Move CString, CStringLen to GHC.ForeignBen Gamari2022-10-111-1/+5
|
* Extend documentation for Data.List, mostly wrt infinite listsBodigrim2022-10-111-6/+8
|
* Export symbolSing, SSymbol, and friends (CLC#85)wip/clc-85Ryan Scott2022-10-062-103/+406
| | | | | | | | | | | | | | | This implements this Core Libraries Proposal: https://github.com/haskell/core-libraries-committee/issues/85 In particular, it: 1. Exposes the `symbolSing` method of `KnownSymbol`, 2. Exports the abstract `SSymbol` type used in `symbolSing`, and 3. Defines an API for interacting with `SSymbol`. This also makes corresponding changes for `natSing`/`KnownNat`/`SNat` and `charSing`/`KnownChar`/`SChar`. This fixes #15183 and addresses part (2) of #21568.
* Rename Solo[constructor] to MkSoloTorsten Schmits2022-09-213-28/+28
| | | | | | | | | | | Part of proposal 475 (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst) Moves all tuples to GHC.Tuple.Prim Updates ghc-prim version (and bumps bounds in dependents) updates haddock submodule updates deepseq submodule updates text submodule
* Add fragmentation statistic to GHC.StatsTeo Camarasu2022-09-211-0/+7
| | | | Implements #21537
* Add `Eq` and `Ord` instances for `Generically1`John Ericson2022-09-201-0/+9
| | | | | These are needed so the subsequent commit overhauling the `*1` classes type-checks.
* Update to Unicode 15.0Pierre Le Marre2022-09-165-7/+7
|
* Fix typosKrzysztof Gogolewski2022-09-141-1/+1
|
* Add native delimited continuations to the RTSAlexis King2022-09-111-0/+1
| | | | | | | | | | | | | | | | | | | | | This patch implements GHC proposal 313, "Delimited continuation primops", by adding native support for delimited continuations to the GHC RTS. All things considered, the patch is relatively small. It almost exclusively consists of changes to the RTS; the compiler itself is essentially unaffected. The primops come with fairly extensive Haddock documentation, and an overview of the implementation strategy is given in the Notes in rts/Continuation.c. This first stab at the implementation prioritizes simplicity over performance. Most notably, every continuation is always stored as a single, contiguous chunk of stack. If one of these chunks is particularly large, it can result in poor performance, as the current implementation does not attempt to cleverly squeeze a subset of the stack frames into the existing stack: it must fit all at once. If this proves to be a performance issue in practice, a cleverer strategy would be a worthwhile target for future improvements.
* typoEric Lindblad2022-09-071-1/+1
|
* Document that threadDelay / timeout are susceptible to overflows on 32-bit ↵Bodigrim2022-08-107-0/+45
| | | | machines
* base: Fix races in IOManager (setNumCapabilities,closeFdWith)Douglas Wilson2022-08-101-19/+75
| | | | | | | | | | | | | Fix for #21651 Fixes three bugs: - writes to eventManager should be atomic. It is accessed concurrently by ioManagerCapabilitiesChanged and closeFdWith. - The race in closeFdWith described in the ticket. - A race in getSystemEventManager where it accesses the 'IOArray' in 'eventManager' before 'ioManagerCapabilitiesChanged' has written to 'eventManager', causing an Array Index exception. The fix here is to 'yield' and retry.
* base: Share finalization thread labelBen Gamari2022-08-062-4/+12
| | | | | | For efficiency's sake we float the thread label assigned to the finalization thread to the top-level, ensuring that we only need to encode the label once.
* Add a primop to query the label of a threadBen Gamari2022-08-061-0/+15
|
* rts: Move thread labels into TSOBen Gamari2022-08-063-14/+19
| | | | | | | This eliminates the thread label HashTable and instead tracks this information in the TSO, allowing us to use proper StgArrBytes arrays for backing the label and greatly simplifying management of object lifetimes when we expose them to the user with the coming `threadLabel#` primop.
* Add primop to list threadsBen Gamari2022-08-062-1/+23
| | | | | | | A user came to #ghc yesterday wondering how best to check whether they were leaking threads. We ended up using the eventlog but it seems to me like it would be generally useful if Haskell programs could query their own threads.
* base: Organize Haddocks in GHC.Conc.SyncBen Gamari2022-08-061-15/+22
|
* Fix since annotations in GHC.Stack.CloneStackMatthew Pickering2022-08-021-5/+5
| | | | Fixes #21894
* Default implementation for mempty/(<>)Gabriella Gonzalez2022-07-251-1/+21
| | | | | | | | | | | | Approved by: https://github.com/haskell/core-libraries-committee/issues/61 This adds a default implementation for `mempty` and `(<>)` along with a matching `MINIMAL` pragma so that `Semigroup` and `Monoid` instances can be defined in terms of `sconcat` / `mconcat`. The description for each class has also been updated to include the equivalent set of laws for the `sconcat`-only / `mconcat`-only instances.
* Add a Note summarising GHC's UTF-8 implementationsBen Gamari2022-07-222-0/+44
| | | | | GHC has a somewhat dizzying array of UTF-8 implementations. This note describes why this is the case.
* base: Introduce GHC.Encoding.UTF8Ben Gamari2022-07-221-0/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we copy a subset of the UTF-8 implementation living in `ghc-boot` into `base`, with the intent of dropping the former in the future. For this reason, the `ghc-boot` copy is now CPP-guarded on `MIN_VERSION_base(4,18,0)`. Naturally, we can't copy *all* of the functions defined by `ghc-boot` as some depend upon `bytestring`; we rather just copy those which only depend upon `base` and `ghc-prim`. Further consolidation? ---------------------- Currently GHC ships with at least five UTF-8 implementations: * the implementation used by GHC in `ghc-boot:GHC.Utils.Encoding`; this can be used at a number of types including `Addr#`, `ByteArray#`, `ForeignPtr`, `Ptr`, `ShortByteString`, and `ByteString`. Most of this can be removed in GHC 9.6+2, when the copies in `base` will become available to `ghc-boot`. * the copy of the `ghc-boot` definition now exported by `base:GHC.Encoding.UTF8`. This can be used at `Addr#`, `Ptr`, `ByteArray#`, and `ForeignPtr` * the decoder used by `unpackCStringUtf8#` in `ghc-prim:GHC.CString`; this is specialised at `Addr#`. * the codec used by the IO subsystem in `base:GHC.IO.Encoding.UTF8`; this is specialised at `Addr#` but, unlike the above, supports recovery in the presence of partial codepoints (since in IO contexts codepoints may be broken across buffers) * the implementation provided by the `text` library This does seem a tad silly. On the other hand, these implementations *do* materially differ from one another (e.g. in the types they support, the detail in errors they can report, and the ability to recover from partial codepoints). Consequently, it's quite unclear that further consolidate would be worthwhile.
* typosEric Lindblad2022-07-1818-25/+25
|
* rts: allow NULL to be used as an invalid StgStablePtrAdam Sandberg Ericsson2022-07-071-0/+2
|
* winio: make consoleReadNonBlocking not wait for any events at all.Tamar Christina2022-07-071-9/+30
|
* Cleanup BuiltInSyntax vs UserSyntaxMatthew Pickering2022-06-282-5/+0
| | | | | | | | | | | | There was some confusion about whether FUN/TYPE/One/Many should be BuiltInSyntax or UserSyntax. The answer is certainly UserSyntax as BuiltInSyntax is for things which are directly constructed by the parser rather than going through normal renaming channels. I fixed all the obviously wrong places I could find and added a test for the original bug which was caused by this (#21752) Fixes #21752 #20695 #18302
* Add laws for 'toInteger' and 'toRational'Michael Peyton Jones2022-06-223-0/+21
| | | | | CLC discussion here: https://github.com/haskell/core-libraries-committee/issues/58
* winio: Add support to console handles to handleToHANDLETamar Christina2022-06-181-3/+5
|
* Deprecate TypeInType extensionHaskellMouse2022-06-061-1/+1
| | | | | | | | | | | | | | | | This commit fixes #20312 It deprecates "TypeInType" extension according to the following proposal: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0083-no-type-in-type.rst It has been already implemented. The migration strategy: 1. Disable TypeInType 2. Enable both DataKinds and PolyKinds extensions Metric Decrease: T16875
* Pure Haskell implementation of GHC.UnicodePierre Le Marre2022-06-018-63/+4626
| | | | | | | | | | | | | | | | | | | | | | | | Switch to a pure Haskell implementation of base:GHC.Unicode, based on the implementation of the package unicode-data (https://github.com/composewell/unicode-data/). Approved by CLC as per https://github.com/haskell/core-libraries-committee/issues/59#issuecomment-1132106691. - Remove current Unicode cbits. - Add generator for Unicode property files from Unicode Character Database. - Generate internal modules. - Update GHC.Unicode. - Add unicode003 test for general categories and case mappings. - Add Python scripts to check 'base' Unicode tests outputs and characters properties. Fixes #21375 ------------------------- Metric Decrease: T16875 Metric Increase: T4029 T18304 haddock.base -------------------------
* export IsList from GHC.IsListTeo Camarasu2022-05-292-70/+88
| | | | it is still re-exported from GHC.Exts
* Expand documentation of hIsTerminalDeviceBodigrim2022-05-281-1/+8
|
* Use a class to check validity of withDictwip/withdictKrzysztof Gogolewski2022-05-273-9/+9
| | | | | | | | | | | | This moves handling of the magic 'withDict' function from the desugarer to the typechecker. Details in Note [withDict]. I've extracted a part of T16646Fail to a separate file T16646Fail2, because the new error in 'reify' hides the errors from 'f' and 'g'. WithDict now works with casts, this fixes #21328. Part of #19915
* nonmoving: Fix documentation of GC statistics fieldsBen Gamari2022-05-201-11/+8
| | | | | | These were previously incorrect. Fixes #21553.
* base: Throw exceptions raised while closing finalized HandlesBen Gamari2022-05-193-7/+60
| | | | Fixes #21336.
* base: Introduce [sg]etFinalizerExceptionHandlerBen Gamari2022-05-192-24/+77
| | | | | This introduces a global hook which is called when an exception is thrown during finalization.