summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
...
* ghc-heap: remove wrong Addr# coercion (#23181)Sylvain Henry2023-03-303-14/+13
| | | | | | Conversion from Addr# to I# isn't correct with the JS backend. Also used the opportunity to reenable 64-bit Word/Int tests
* Handle records in the renamersheaf2023-03-294-34/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the field-based logic for disambiguating record updates to the renamer. The type-directed logic, scheduled for removal, remains in the typechecker. To do this properly (and fix the myriad of bugs surrounding the treatment of duplicate record fields), we took the following main steps: 1. Create GREInfo, a renamer-level equivalent to TyThing which stores information pertinent to the renamer. This allows us to uniformly treat imported and local Names in the renamer, as described in Note [GREInfo]. 2. Remove GreName. Instead of a GlobalRdrElt storing GreNames, which distinguished between normal names and field names, we now store simple Names in GlobalRdrElt, along with the new GREInfo information which allows us to recover the FieldLabel for record fields. 3. Add namespacing for record fields, within the OccNames themselves. This allows us to remove the mangling of duplicate field selectors. This change ensures we don't print mangled names to the user in error messages, and allows us to handle duplicate record fields in Template Haskell. 4. Move record disambiguation to the renamer, and operate on the level of data constructors instead, to handle #21443. The error message text for ambiguous record updates has also been changed to reflect that type-directed disambiguation is on the way out. (3) means that OccEnv is now a bit more complex: we first key on the textual name, which gives an inner map keyed on NameSpace: OccEnv a ~ FastStringEnv (UniqFM NameSpace a) Note that this change, along with (2), both increase the memory residency of GlobalRdrEnv = OccEnv [GlobalRdrElt], which causes a few tests to regress somewhat in compile-time allocation. Even though (3) simplified a lot of code (in particular the treatment of field selectors within Template Haskell and in error messages), it came with one important wrinkle: in the situation of -- M.hs-boot module M where { data A; foo :: A -> Int } -- M.hs module M where { data A = MkA { foo :: Int } } we have that M.hs-boot exports a variable foo, which is supposed to match with the record field foo that M exports. To solve this issue, we add a new impedance-matching binding to M foo{var} = foo{fld} This mimics the logic that existed already for impedance-binding DFunIds, but getting it right was a bit tricky. See Note [Record field impedance matching] in GHC.Tc.Module. We also needed to be careful to avoid introducing space leaks in GHCi. So we dehydrate the GlobalRdrEnv before storing it anywhere, e.g. in ModIface. This means stubbing out all the GREInfo fields, with the function forceGlobalRdrEnv. When we read it back in, we rehydrate with rehydrateGlobalRdrEnv. This robustly avoids any space leaks caused by retaining old type environments. Fixes #13352 #14848 #17381 #17551 #19664 #21443 #21444 #21720 #21898 #21946 #21959 #22125 #22160 #23010 #23062 #23063 Updates haddock submodule ------------------------- Metric Increase: MultiComponentModules MultiLayerModules MultiLayerModulesDefsGhci MultiLayerModulesNoCode T13701 T14697 hard_hole_fits -------------------------
* Add COMPLETE pragmas to TypeRep, SSymbol, SChar, and SNatRyan Scott2023-03-286-0/+30
| | | | | This implements [CLC proposal #149](https://github.com/haskell/core-libraries-committee/issues/149).
* Document the constructor name for listsDavid Feuer2023-03-261-1/+4
| | | | | | | | | Derived `Data` instances use raw infix constructor names when applicable. The `Data.Data [a]` instance, if derived, would have a constructor name of `":"`. However, it actually uses constructor name `"(:)"`. Document this peculiarity. See https://github.com/haskell/core-libraries-committee/issues/147
* Update and expand atomic modification HaddocksDavid Feuer2023-03-262-14/+67
| | | | | | | | | | * 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-253-1/+27
| | | | 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.
* base: Document GHC versions associated with past base versions in the changelogLi-yao Xia2023-03-251-1/+8
|
* Update changelog to mention changes to instance Foldable (Compose f g)Bodigrim2023-03-231-0/+2
|
* Simplify minimum/maximum in instance Foldable (Compose f g)Bodigrim2023-03-231-6/+2
|
* Additional optimized versionsArmando Ramirez2023-03-231-3/+18
|
* Optimized Foldable methods for Data.Functor.ComposeArmando Ramirez2023-03-231-0/+7
| | | | | | Explicitly define length, elem, etc. in Foldable instance for Data.Functor.Compose Implementation of https://github.com/haskell/core-libraries-committee/issues/57
* fix: Incorrect @since annotations in GHC.TypeErrorromes2023-03-222-5/+5
| | | | Fixes #23128
* Rename () into Unit, (,,...,,) into Tuple<n> (#21294)Andrei Borzenkov2023-03-213-95/+118
| | | | | | | | | | | | | | | | | | | | | This patch implements a part of GHC Proposal #475. The key change is in GHC.Tuple.Prim: - data () = () - data (a,b) = (a,b) - data (a,b,c) = (a,b,c) ... + data Unit = () + data Tuple2 a b = (a,b) + data Tuple3 a b c = (a,b,c) ... And the rest of the patch makes sure that Unit and Tuple<n> are pretty-printed as () and (,,...,,) in various contexts. Updates the haddock submodule. Co-authored-by: Vladislav Zavialov <vlad.z.4096@gmail.com>
* ghc-bignum: Drop redundant include-dirs fieldBen Gamari2023-03-131-2/+0
|
* Bump Win32 to 2.13.4.0wip/bump-w32Matthew Pickering2023-03-131-0/+0
| | | | Updates Win32 submodule
* testsuite: Skip some tests when sanity checking is enabledBen Gamari2023-03-081-1/+2
|
* Fix documentation for traceWith and friendsMorrowM2023-03-072-3/+6
|
* Add `Data.Functor.unzip`Ollie Charles2023-03-072-0/+6
| | | | | | This function is currently present in `Data.List.NonEmpty`, but `Data.Functor` is a better home for it. This change was discussed and approved by the CLC at https://github.com/haskell/core-libraries-committee/issues/88.
* Documentation: describe laziness of several function from Data.ListBodigrim2023-03-062-16/+150
|
* Add decideSymbol, decideChar, decideNat, decTypeRep, decT and hdecTOleg Grenrus2023-03-046-20/+181
| | | | | | These all type-level equality decision procedures. Implementes a CLC proposal https://github.com/haskell/core-libraries-committee/issues/98
* Document getSoloDavid Feuer2023-03-031-0/+20
|
* Export getSolo from Data.TupleDavid Feuer2023-03-032-1/+4
| | | | | | | Proposed in [CLC proposal #113](https://github.com/haskell/core-libraries-committee/issues/113) and [approved by the CLC](https://github.com/haskell/core-libraries-committee/issues/113#issuecomment-1452452191)
* 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
* ghc-prim: fix hs_cmpxchg64 function prototypeCheng Shao2023-02-281-2/+2
| | | | | | | hs_cmpxchg64 must return a StgWord64, otherwise incorrect runtime results of 64-bit MO_Cmpxchg will appear in 32-bit unregisterised builds, which go unnoticed at compile-time due to C implicit casting in .hc files.
* Bump haskeline submodule to 0.8.2.1Ben Gamari2023-02-241-0/+0
|
* Bump filepath submodule to 1.4.100.1Ben Gamari2023-02-241-0/+0
|
* Bump Cabal submodule to 3.9 pre-releaseBen Gamari2023-02-241-0/+0
|
* Bump array submodule to 0.5.4.0Ben Gamari2023-02-241-0/+0
|
* Bump process submodule to v1.6.17.0Ben Gamari2023-02-241-0/+0
|
* Bump directory submodule to 1.3.8.1Ben Gamari2023-02-241-0/+0
|
* Bump deepseq submodule to 1.4.8.1Ben Gamari2023-02-241-0/+0
|
* Bump unix submodule to 2.8.1.0Ben Gamari2023-02-241-0/+0
|
* Bump terminfo submodule to 0.4.1.6Ben Gamari2023-02-241-0/+0
|
* base: Correct @since annotation for FP<->Integral bit cast operations.Andreas Klebinger2023-02-211-4/+4
| | | | Fixes #22708
* ghc-prim: levity-polymorphic array equality opssheaf2023-02-212-11/+31
| | | | | | | | | This patch changes the pointer-equality comparison operations in GHC.Prim.PtrEq to work with arrays of unlifted values, e.g. sameArray# :: forall {l} (a :: TYPE (BoxedRep l)). Array# a -> Array# a -> Int# Fixes #22976
* Bump submodule text to 2.0.2Bodigrim2023-02-211-0/+0
|
* Merge libiserv with ghciSylvain Henry2023-02-178-143/+93
| | | | | | | | | | `libiserv` serves no purpose. As it depends on `ghci` and doesn't have more dependencies than the `ghci` package, its code could live in the `ghci` package too. This commit also moves most of the code from the `iserv` program into the `ghci` package as well so that it can be reused. This is especially useful for the implementation of TH for the JS backend (#22261, !9779).
* Add INLINABLE pragmas to `generic*` functions in Data.OldListwip/generic-inlinableMatthew Pickering2023-02-172-0/+7
| | | | | | | | | | | | | These functions are * recursive * overloaded So it's important to add an `INLINABLE` pragma to each so that they can be specialised at the use site when the specific numeric type is known. Adding these pragmas improves the LazyText replicate benchmark (see https://gitlab.haskell.org/ghc/ghc/-/issues/22886#note_481020) https://github.com/haskell/core-libraries-committee/issues/129
* unicode: Don't inline bitmap in generalCategoryMatthew Pickering2023-02-163-2/+11
| | | | | | | | | | | | | | | | | 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-1610-25/+49
| | | | | | | | | | | | 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-162-3/+24
|
* base: Note move of GHC.Stack.CCS.whereFrom to GHC.InfoProv in changelogBen Gamari2023-02-161-0/+8
| | | | Fixes #22883.
* Testsuite: mark T13167 as fragile for JS (#22921)Sylvain Henry2023-02-161-1/+2
|
* Documentation: Improve Foldable1 documentationmeooow252023-02-141-68/+91
| | | | | | | | | | | | | * Explain foldrMap1, foldlMap1, foldlMap1', and foldrMap1' in greater detail, the text is mostly adapted from documentation of Foldable. * Describe foldr1, foldl1, foldl1' and foldr1' in terms of the above functions instead of redoing the full explanation. * Small updates to documentation of fold1, foldMap1 and toNonEmpty, again adapting from Foldable. * Update the foldMap1 example to lists instead of Sum since this is recommended for lazy right-associative folds. Fixes #22847
* base: Move changelog entry to its placeLi-yao Xia2023-02-141-4/+4
|
* Testsuite: decrease length001 timeout for JS (#22921)Sylvain Henry2023-02-101-1/+3
|
* Add Lift instance for Fixedparsonsmatt2023-02-102-0/+11
|
* Update `Data.List.singleton` doc commentkonsumlamm2023-02-091-1/+1
|
* Bump transformers to 0.6.1.0sheaf2023-02-091-0/+0
| | | | | | | This allows us to avoid orphans for Foldable1 instances, fixing #22898. Updates transformers submodule.