summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* Numeric exceptions: replace FFI calls with primopsSylvain Henry2022-10-251-18/+4
| | | | | | | | | | | | | ghc-bignum needs a way to raise numerical exceptions defined in base package. At the time we used FFI calls into primops defined in the RTS. These FFI calls had to be wrapped into hacky bottoming functions because "foreign import prim" syntax doesn't support giving a bottoming demand to the foreign call (cf #16929). These hacky wrapper functions trip up the JavaScript backend (#21078) because they are polymorphic in their return type. This commit replaces them with primops very similar to raise# but raising predefined exceptions.
* template-haskell: Improve documentation of strictness annotation typesTeo Camarasu2022-10-211-6/+18
| | | | | | | | Before it was undocumentated that DecidedLazy can be returned by reifyConStrictness for strict fields. This can happen when a field has an unlifted type or its the single field of a newtype constructor. Fixes #21380
* build: get rid of `HAVE_TIME_H`Nicolas Trangez2022-10-214-9/+1
| | | | | | | | | | | | As advertized by `autoreconf`: > All current systems provide time.h; it need not be checked for. Hence, remove the check for it in `configure.ac` and remove conditional inclusion of the header in `HAVE_TIME_H` blocks where applicable. The `time.h` header was being included in various source files without a `HAVE_TIME_H` guard already anyway.
* 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 `Enum (Down a)` instance that swaps `succ` and `pred`Gergo ERDI2022-10-172-2/+25
| | | | | | | | | | | See https://github.com/haskell/core-libraries-committee/issues/51 for discussion. The key points driving the implementation are the following two ideas: * For the `Int` type, `comparing (complement @Int)` behaves exactly as an order-swapping `compare @Int`. * `enumFrom @(Down a)` can be implemented in terms of `enumFromThen @a`, if only the corner case of starting at the very end is handled specially
* Add type signatures in where-clause of Data.List.permutationsBodigrim2022-10-141-7/+12
| | | | The type of interleave' is very much revealing, otherwise it's extremely tough to decipher.
* Add standard Unicode case predicates isUpperCase and isLowerCase.Pierre Le Marre2022-10-1411-51/+195
| | | | | | | | 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-114-75/+106
|
* base: Move CString, CStringLen to GHC.ForeignBen Gamari2022-10-112-11/+6
|
* ByteArray# is unlifted, not unboxedBodigrim2022-10-111-4/+4
|
* Expand comment for Data.List.permutationsjwaldmann2022-10-111-0/+3
|
* Extend documentation for Data.List, mostly wrt infinite listsBodigrim2022-10-113-53/+216
|
* Add a newline before since pragma in Data.Array.ByteBodigrim2022-10-101-0/+1
|
* Export symbolSing, SSymbol, and friends (CLC#85)wip/clc-85Ryan Scott2022-10-066-103/+447
| | | | | | | | | | | | | | | 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.
* Minor fixes following Unicode 15.0.0 updatePierre Le Marre2022-10-052-8/+4
| | | | | - Fix changelog for Unicode 15.0.0 - Fix the checksums of the downloaded Unicode files, in base's tool: "ucd2haskell".
* Use sameByteArray# in sameByteArrayOleg Grenrus2022-10-041-2/+1
|
* INLINE/INLINEABLE pragmas in Foreign.Marshal.ArraySimon Peyton Jones2022-09-281-1/+31
| | | | | | | | | | | Foreign.Marshal.Array contains many small functions, all of which are overloaded, and which are critical for performance. Yet none of them had pragmas, so it was a fluke whether or not they got inlined. This patch makes them all either INLINE (small ones) or INLINEABLE and hence specialisable (larger ones). See Note [Specialising array operations] in that module.
* implement proposal 106 (Define Kinds Without Promotion) (fixes #6024)Ross Paterson2022-09-272-0/+1
| | | | includes corresponding changes to haddock submodule
* Update filepath to filepath-1.4.100.0Matthew Pickering2022-09-222-24/+7
| | | | | | | | | | Updates submodule * Always rely on vendored filepath * filepath must be built as stage0 dependency because it uses template-haskell. Towards #22098
* Rename Solo[constructor] to MkSoloTorsten Schmits2022-09-2117-253/+289
| | | | | | | | | | | 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-212-0/+8
| | | | Implements #21537
* Add notes to ghc-prim Haddocks that users should not import itTom Ellis2022-09-207-0/+23
|
* Relax instances for Functor combinators; put superclass on Class1 and Class2 ↵John Ericson2022-09-205-67/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to make non-breaking This change is approved by the Core Libraries commitee in https://github.com/haskell/core-libraries-committee/issues/10 The first change makes the `Eq`, `Ord`, `Show`, and `Read` instances for `Sum`, `Product`, and `Compose` match those for `:+:`, `:*:`, and `:.:`. These have the proper flexible contexts that are exactly what the instance needs: For example, instead of ```haskell instance (Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) where (==) = eq1 ``` we do ```haskell deriving instance Eq (f (g a)) => Eq (Compose f g a) ``` But, that change alone is rather breaking, because until now `Eq (f a)` and `Eq1 f` (and respectively the other classes and their `*1` equivalents too) are *incomparable* constraints. This has always been an annoyance of working with the `*1` classes, and now it would rear it's head one last time as an pesky migration. Instead, we give the `*1` classes superclasses, like so: ```haskell (forall a. Eq a => Eq (f a)) => Eq1 f ``` along with some laws that canonicity is preserved, like: ```haskell liftEq (==) = (==) ``` and likewise for `*2` classes: ```haskell (forall a. Eq a => Eq1 (f a)) => Eq2 f ``` and laws: ```haskell liftEq2 (==) = liftEq1 ``` The `*1` classes also have default methods using the `*2` classes where possible. What this means, as explained in the docs, is that `*1` classes really are generations of the regular classes, indicating that the methods can be split into a canonical lifting combined with a canonical inner, with the super class "witnessing" the laws[1] in a fashion. Circling back to the pragmatics of migrating, note that the superclass means evidence for the old `Sum`, `Product`, and `Compose` instances is (more than) sufficient, so breakage is less likely --- as long no instances are "missing", existing polymorphic code will continue to work. Breakage can occur when a datatype implements the `*1` class but not the corresponding regular class, but this is almost certainly an oversight. For example, containers made that mistake for `Tree` and `Ord`, which I fixed in https://github.com/haskell/containers/pull/761, but fixing the issue by adding `Ord1` was extremely *un*controversial. `Generically1` was also missing `Eq`, `Ord`, `Read,` and `Show` instances. It is unlikely this would have been caught without implementing this change. ----- [1]: In fact, someday, when the laws are part of the language and not only documentation, we might be able to drop the superclass field of the dictionary by using the laws to recover the superclass in an instance-agnostic manner, e.g. with a *non*-overloaded function with type: ```haskell DictEq1 f -> DictEq a -> DictEq (f a) ``` But I don't wish to get into optomizations now, just demonstrate the close relationship between the law and the superclass. Bump haddock submodule because of test output changing.
* Add `Eq` and `Ord` instances for `Generically1`John Ericson2022-09-202-0/+10
| | | | | These are needed so the subsequent commit overhauling the `*1` classes type-checks.
* Avoid partial head and tail in ghc-heap; replace with total pattern-matchingBodigrim2022-09-162-104/+83
|
* Update to Unicode 15.0Pierre Le Marre2022-09-1611-79/+80
|
* Fix typosKrzysztof Gogolewski2022-09-142-2/+2
|
* libraries: template-haskell: vendor filepath differentlyDouglas Wilson2022-09-145-1/+2249
| | | | | | Vendoring with ../ in hs-source-dirs prevents upload to hackage. (cherry picked from commit 1446be7586ba70f9136496f9b67f792955447842)
* Diagnostic codes: acccept test changessheaf2022-09-131-1/+1
| | | | | | | | The testsuite output now contains diagnostic codes, so many tests need to be updated at once. We decided it was best to keep the diagnostic codes in the testsuite output, so that contributors don't inadvertently make changes to the diagnostic codes.
* Add native delimited continuations to the RTSAlexis King2022-09-114-1/+29
| | | | | | | | | | | | | | | | | | | | | 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.
* Bump submodule Cabal to one with liftA2 warnings fixedGeorgi Lyubenov2022-09-081-0/+0
|
* Bump submodule containers to one with liftA2 warnings fixedGeorgi Lyubenov2022-09-081-0/+0
|
* Add changelog entry for liftA2 export from PreludeGeorgi Lyubenov2022-09-081-0/+4
|
* Export liftA2 from PreludeGeorgi Lyubenov2022-09-087-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: In order to be warning free and compatible, we hide Applicative(..) from Prelude in a few places and instead import it directly from Control.Applicative. Please see the migration guide at https://github.com/haskell/core-libraries-committee/blob/main/guides/export-lifta2-prelude.md for more details. This means that Applicative is now exported in its entirety from Prelude. Motivation: This change is motivated by a few things: * liftA2 is an often used function, even more so than (<*>) for some people. * When implementing Applicative, the compiler will prompt you for either an implementation of (<*>) or of liftA2, but trying to use the latter ends with an error, without further imports. This could be confusing for newbies. * For teaching, it is often times easier to introduce liftA2 first, as it is a natural generalisation of fmap. * This change seems to have been unanimously and enthusiastically accepted by the CLC members, possibly indicating a lot of love for it. * This change causes very limited breakage, see the linked issue below for an investigation on this. See https://github.com/haskell/core-libraries-committee/issues/50 for the surrounding discussion and more details.
* typoEric Lindblad2022-09-071-1/+1
|
* Change Ord defaults per CLC proposalTommy Bidne2022-09-012-3/+7
| | | | Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/24#issuecomment-1233331267
* Update submodule Cabal to tag Cabal-v3.8.1.0wip/9.4-foward-fixed-makeDouglas Wilson2022-08-313-2/+2
| | | | closes #21931
* Bump bytestring submodule to 0.11.3.1Ben Gamari2022-08-311-0/+0
|
* Add dates to base, ghc-prim changelogsBen Gamari2022-08-311-1/+1
|
* Bump deepseq submodule to 1.4.8.0Ben Gamari2022-08-311-0/+0
|
* Bump text submodule to 2.0.1Douglas Wilson2022-08-311-0/+0
|
* Bump directory submodule to 1.3.7.1Ben Gamari2022-08-311-0/+0
|
* Update submodule process to 1.6.15.0Douglas Wilson2022-08-311-0/+0
|
* Update submodule containers to 0.6.6Douglas Wilson2022-08-311-0/+0
|
* Bump stm submodule to 2.5.1.0Ben Gamari2022-08-311-0/+0
|
* Bump binary submodule to 0.8.9.1Ben Gamari2022-08-311-0/+0
|
* Fix typo in Any docs: syntatic -> syntacticPi Delport2022-08-301-1/+1
|
* Fix typo in Any docs: stray "--"Pi Delport2022-08-301-1/+1
|