summaryrefslogtreecommitdiff
path: root/libraries/base/GHC
Commit message (Collapse)AuthorAgeFilesLines
* base: Introduce printToHandleFinalizerExceptionHandlerBen Gamari2023-05-165-2/+29
|
* Use unboxed codebuffers in baseJosh Meredith2023-05-158-493/+596
| | | | | Metric Decrease: encodingAllocations
* Replace the implementation of CodeBuffers with unboxed typesJosh Meredith2023-05-151-11/+50
|
* Document unlawfulness of instance Num FixedBodigrim2023-05-111-2/+2
| | | | Fixes #22712
* base: Export GHC.Conc.Sync.fromThreadIdBen Gamari2023-05-111-1/+9
| | | | Closes #22706.
* compiler: Implement atomicSwapIORef with xchgBen Gamari2023-05-091-6/+1
| | | | As requested by @treeowl in CLC#139.
* Document instances of DoubleBodigrim2023-05-032-28/+94
|
* Add the Unsatisfiable classsheaf2023-04-291-10/+65
| | | | | | | | | This commit implements GHC proposal #433, adding the Unsatisfiable class to the GHC.TypeError module. This provides an alternative to TypeError for which error reporting is more predictable: we report it when we are reporting unsolved Wanted constraints. Fixes #14983 #16249 #16906 #18310 #20835
* Fix doc typos in libraries/base/GHCtocic2023-04-216-8/+8
|
* Fix doc typo in GHC.Read.readListtocic2023-04-201-2/+2
|
* Misc cleanupKrzysztof Gogolewski2023-04-175-5/+4
| | | | | | - Use dedicated list functions - Make cloneBndrs and cloneRecIdBndrs monadic - Fix invalid haddock comments in libraries/base
* Base/JS: GHC.JS.Foreign.Callback module (issue 23126)Josh Meredith2023-04-132-4/+152
| | | | | | | | | | | | | * Add the Callback module for "exporting" Haskell functions to be available to plain JavaScript code * Fix some primitives defined in GHC.JS.Prim * Add a JavaScript section to the user guide with instructions on how to use the JavaScript FFI, building up to using Callbacks to interact with the browser * Add tests for the JavaScript FFI and Callbacks
* Adjust wording wrt representation polymorphism of ($)Sebastian Graf2023-04-071-1/+1
|
* Remove trailing whitespace from ($) commentaryAlex Dixon2023-04-071-3/+3
|
* Improve documentation for ($) (#22963)Alex Dixon2023-04-071-12/+63
|
* [feat] make ($) representation polymorphicmangoiv2023-04-011-4/+12
| | | | | | | | | | | | | | - this change was approved by the CLC in [1] following a CLC proposal [2] - make ($) representation polymorphic (adjust the type signature) - change ($) implementation to allow additional polymorphism - adjust the haddock of ($) to reflect these changes - add additional documentation to document these changes - add changelog entry - adjust tests (move now succeeding tests and adjust stdout of some tests) [1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854 [2] https://github.com/haskell/core-libraries-committee/issues/132
* Add {-# WARNING #-} to Data.List.{head,tail}Bodigrim2023-03-301-0/+4
|
* Add COMPLETE pragmas to TypeRep, SSymbol, SChar, and SNatRyan Scott2023-03-282-0/+3
| | | | | This implements [CLC proposal #149](https://github.com/haskell/core-libraries-committee/issues/149).
* Update and expand atomic modification HaddocksDavid Feuer2023-03-261-5/+34
| | | | | | | | | | * The documentation for `atomicModifyIORef` and `atomicModifyIORef'` were incomplete, and the documentation for `atomicModifyIORef` was out of date. Update and expand. * Remove a useless lazy pattern match in the definition of `atomicModifyIORef`. The pair it claims to match lazily was already forced by `atomicModifyIORef2`.
* Add Eq/Ord instances for SSymbol, SChar, and SNatRyan Scott2023-03-252-1/+25
| | | | This implements [CLC proposal #148](https://github.com/haskell/core-libraries-committee/issues/148).
* Modify ThreadId documentation and commentsDavid Feuer2023-03-251-7/+3
| | | | | | | | | | | | | | | | | | | | | | For a long time, `GHC.Conc.Sync` has said ```haskell -- ToDo: data ThreadId = ThreadId (Weak ThreadId#) -- But since ThreadId# is unlifted, the Weak type must use open -- type variables. ``` We are now actually capable of using `Weak# ThreadId#`, but the world has moved on. To support the `Show` and `Ord` instances, we'd need to store the thread ID number in the `ThreadId`. And it seems very difficult to continue to support `threadStatus` in that regime, since it needs to be able to explain how threads died. In addition, garbage collection of weak references can be quite expensive, and it would be hard to evaluate the cost over he whole ecosystem. As discussed in [this CLC issue](https://github.com/haskell/core-libraries-committee/issues/125), it doesn't seem very likely that we'll actually switch to weak references here.
* fix: Incorrect @since annotations in GHC.TypeErrorromes2023-03-221-2/+2
| | | | Fixes #23128
* Documentation: describe laziness of several function from Data.ListBodigrim2023-03-061-14/+90
|
* Add decideSymbol, decideChar, decideNat, decTypeRep, decT and hdecTOleg Grenrus2023-03-042-12/+114
| | | | | | These all type-level equality decision procedures. Implementes a CLC proposal https://github.com/haskell/core-libraries-committee/issues/98
* Revert the main payload of "Make `drop` and `dropWhile` fuse (#18964)"Sebastian Graf2023-03-011-33/+8
| | | | | | | | | | | | | | | | This reverts the bits affecting fusion of `drop` and `dropWhile` of commit 0f7588b5df1fc7a58d8202761bf1501447e48914 and keeps just the small refactoring unifying `flipSeqTake` and `flipSeqScanl'` into `flipSeq`. It also adds a new test for #23021 (which was the reason for reverting) as well as adds a clarifying comment to T18964. Fixes #23021, unfixes #18964. Metric Increase: T18964 Metric Decrease: T18964
* base: Correct @since annotation for FP<->Integral bit cast operations.Andreas Klebinger2023-02-211-4/+4
| | | | Fixes #22708
* unicode: Don't inline bitmap in generalCategoryMatthew Pickering2023-02-161-1/+4
| | | | | | | | | | | | | | | | | generalCategory contains a huge literal string but is marked INLINE, this will duplicate the string into any use site of generalCategory. In particular generalCategory is used in functions like isSpace and the literal gets inlined into this function which makes it massive. https://github.com/haskell/core-libraries-committee/issues/130 Fixes #22949 ------------------------- Metric Decrease: T4029 T18304 -------------------------
* No default finalizer exception handlersheaf2023-02-161-8/+5
| | | | | | | | | | | | Commit cfc8e2e2 introduced a mechanism for handling of exceptions that occur during Handle finalization, and 372cf730 set the default handler to print out the error to stderr. However, #21680 pointed out we might not want to set this by default, as it might pollute users' terminals with unwanted information. So, for the time being, the default handler discards the exception. Fixes #21680
* Documentation: add an example of SPEC usageBodigrim2023-02-161-2/+5
|
* Revert "Use fix-sized equality primops for fixed size boxed types"Ben Gamari2023-02-072-12/+12
| | | | | | | | | | This reverts commit 024020c38126f3ce326ff56906d53525bc71690c. This was never applied to master/9.6 originally. See #20405 for why using these primops is a bad idea. (cherry picked from commit b1d109ad542e4c37ae5af6ace71baf2cb509d865)
* JS: replace "js" architecture with "javascript"Sylvain Henry2023-02-0613-34/+34
| | | | | | | | | | | | | | | Despite Cabal supporting any architecture name, `cabal --check` only supports a few built-in ones. Sadly `cabal --check` is used by Hackage hence using any non built-in name in a package (e.g. `arch(js)`) is rejected and the package is prevented from being uploaded on Hackage. Luckily built-in support for the `javascript` architecture was added for GHCJS a while ago. In order to allow newer `base` to be uploaded on Hackage we make the switch from `js` to `javascript` architecture. Fixes #22740. Co-authored-by: Ben Gamari <ben@smart-cactus.org>
* Revert "Use fix-sized bit-fiddling primops for fixed size boxed types"Ben Gamari2023-02-042-116/+71
| | | | | | | | This reverts commit 4512ad2d6a8e65ea43c86c816411cb13b822f674. This was never applied to master/9.6 originally. (cherry picked from commit a44bdc2720015c03d57f470b759ece7fab29a57a)
* base: Fix Note references in GHC.IO.Handle.TypesBen Gamari2023-02-031-12/+12
|
* doc: fix gcdetails_block_fragmentation_bytes since annotationTeo Camarasu2023-02-011-1/+2
|
* tryFillBuffer: strictifydoyougnu2023-01-261-10/+10
| | | | more speculative bangs
* Add safe list indexing operator: !?Oleg Grenrus2023-01-091-5/+30
| | | | | | With Joachim's amendments. Implements https://github.com/haskell/core-libraries-committee/issues/110
* Misc cleanupKrzysztof Gogolewski2023-01-051-1/+1
| | | | | | | | | - Remove unused uniques and hs-boot declarations - Fix types of seq and unsafeCoerce# - Remove FastString/String roundtrip in JS - Use TTG to enforce totality - Remove enumeration in Heap/Inspect; the 'otherwise' clause serves the primitive types well.
* base: Fix event manager shutdown race on non-Linux platformsBen Gamari2022-12-221-3/+10
| | | | | | | During shutdown it's possible that we will attempt to use a closed fd to wakeup another capability's event manager. On the Linux eventfd path we were careful to handle this. However on the non-Linux path we failed to do so. Fix this.
* Make `drop` and `dropWhile` fuse (#18964)Sebastian Graf2022-12-081-25/+44
| | | | | | | I copied the fusion framework we have in place for `take`. T18964 asserts that we regress neither when fusion fires nor when it doesn't. Fixes #18964.
* Make (^) INLINE (#22324)Sebastian Graf2022-12-081-24/+57
| | | | | | | | | | | | | So that we get to cancel away the allocation for the lazily used base. We can move `powImpl` (which *is* strict in the base) to the top-level so that we don't duplicate too much code and move the SPECIALISATION pragmas onto `powImpl`. The net effect of this change is that `(^)` plays along much better with inlining thresholds and loopification (#22227), for example in `x2n1`. Fixes #22324.
* Make Functor a quantified superclass of Bifunctor.Baldur Blöndal2022-11-301-0/+12
| | | | | | | | | | | See https://github.com/haskell/core-libraries-committee/issues/91 for discussion. This change relates Bifunctor with Functor by requiring second = fmap. Moreover this change is a step towards unblocking the major version bump of bifunctors and profunctors to major version 6. This paves the way to move the Profunctor class into base. For that Functor first similarly becomes a superclass of Profunctor in the new major version 6.
* Move Void to GHC.Base...Oleg Grenrus2022-11-306-1/+62
| | | | | | | | | | | | | This change would allow `Void` to be used deeper in module graph. For example exported from `Prelude` (though that might be already possible). Also this change includes a change `stimes @Void _ x = x`, https://github.com/haskell/core-libraries-committee/issues/95 While the above is not required, maintaining old stimes behavior would be tricky as `GHC.Base` doesn't know about `Num` or `Integral`, which would require more hs-boot files.
* Fix @since annotations on WithDict and Coerciblesheaf2022-11-301-0/+2
| | | | Fixes #22453
* Add Javascript backendSylvain Henry2022-11-2914-22/+1970
| | | | | | | | | | | | | | | Add JS backend adapted from the GHCJS project by Luite Stegeman. Some features haven't been ported or implemented yet. Tests for these features have been disabled with an associated gitlab ticket. Bump array submodule Work funded by IOG. Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io> Co-authored-by: Luite Stegeman <stegeman@gmail.com> Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* Assorted fixes to avoid Data.List.{head,tail}Bodigrim2022-11-251-1/+1
|
* Add unsafePtrEquality# restricted to UnliftedTypesOleg Grenrus2022-11-222-2/+4
|
* 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.