summaryrefslogtreecommitdiff
path: root/libraries/base/GHC
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Re-export augment and build from GHC.ListBen Gamari2022-05-131-0/+3
| | | | Resolves https://gitlab.haskell.org/ghc/ghc/-/issues/19127
* Fix broken rules for (^) with known small powersMatthew Craven2022-05-051-12/+11
|
* libraries/base: docs: Explain relationshipt between `finalizeForeignPtr` and ↵Niklas Hambüchen2022-05-021-6/+13
| | | | | | `*Conc*` creation Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/21420
* winio: add support to iserv.Tamar Christina2022-04-281-1/+1
|
* add since annotation for GHC.Stack.CCS.whereFromTeo Camarasu2022-04-281-0/+2
|
* Add INLINE pragmas for Enum helper methodsSimon Peyton Jones2022-04-282-15/+63
| | | | | | | | | | | | | | | | | | | | | | | As #21343 showed, we need to be super-certain that the "helper methods" for Enum instances are actually inlined or specialised. I also tripped over this when I discovered that numericEnumFromTo and friends had no pragmas at all, so their performance was very fragile. If they weren't inlined, all bets were off. So I've added INLINE pragmas for them too. See new Note [Inline Enum method helpers] in GHC.Enum. I also expanded Note [Checking for INLINE loop breakers] in GHC.Core.Lint to explain why an INLINE function might temporarily be a loop breaker -- this was the initial bug report in #21343. Strangely we get a 16% runtime allocation decrease in perf/should_run/T15185, but only on i386. Since it moves in the right direction I'm disinclined to investigate, so I'll accept it. Metric Decrease: T15185
* Documentation for setLocaleEncodingBodigrim2022-04-271-2/+27
|
* Fix rendering of liftA haddockLi-yao Xia2022-04-251-2/+1
|
* Improve error messages from GHC.IO.Encoding.FailureBodigrim2022-04-221-8/+12
|
* Rename [] to List (#21294)Vladislav Zavialov2022-04-072-2/+4
| | | | | | | | | | | | | This patch implements a small part of GHC Proposal #475. The key change is in GHC.Types: - data [] a = [] | a : [a] + data List a = [] | a : List a And the rest of the patch makes sure that List is pretty-printed as [] in various contexts. Updates the haddock submodule.
* Implement \cases (Proposal 302)Jakob Bruenker2022-04-011-1/+0
| | | | | | | | | | | | This commit implements proposal 302: \cases - Multi-way lambda expressions. This adds a new expression heralded by \cases, which works exactly like \case, but can match multiple apats instead of a single pat. Updates submodule haddock to support the ITlcases token. Closes #20768
* Change may not to might notMaxHearnden2022-04-011-1/+1
|
* hi haddock: Lex and store haddock docs in interface filesZubin Duggal2022-03-231-0/+1
| | | | | | | | | | | | | | | | | | Names appearing in Haddock docstrings are lexed and renamed like any other names appearing in the AST. We currently rename names irrespective of the namespace, so both type and constructor names corresponding to an identifier will appear in the docstring. Haddock will select a given name as the link destination based on its own heuristics. This patch also restricts the limitation of `-haddock` being incompatible with `Opt_KeepRawTokenStream`. The export and documenation structure is now computed in GHC and serialised in .hi files. This can be used by haddock to directly generate doc pages without reparsing or renaming the source. At the moment the operation of haddock is not modified, that's left to a future patch. Updates the haddock submodule with the minimum changes needed.
* Improve clearBit and complementBit for NaturalSimon Jakobi2022-03-111-4/+5
| | | | | | Also optimize bigNatComplementBit#. Fixes #21175, #21181, #21194.
* Improve setBit for NaturalSimon Jakobi2022-03-071-0/+1
| | | | | | | Previously the default definition was used, which involved allocating intermediate Natural values. Fixes #21173.
* remove MonadFail instances of STArtem Pelenitsyn2022-03-051-5/+0
| | | | | | | | CLC proposal: https://github.com/haskell/core-libraries-committee/issues/33 The instances had `fail` implemented in terms of `error`, whereas the idea of the `MonadFail` class is that the `fail` method should be implemented in terms of the monad itself.
* base: Mark GHC.Bits not-home for haddockSimon Jakobi2022-03-041-0/+2
| | | | | Most (all) of the exports are re-exported from the preferable Data.Bits.
* Use Word64# primops in Word64 Num instanceSylvain Henry2022-03-031-3/+3
| | | | Taken froù!3658
* Make modules in base stable.Hécate Moonlight2022-02-288-8/+8
| | | | fix #18963
* Add Monoid a => Monoid (STM a) instanceOleg Grenrus2022-02-281-0/+8
|
* base: Improve documentation of `throwIO` (#19854)Sebastian Graf2022-02-251-4/+22
| | | | | | Now it takes a better account of precise vs. imprecise exception semantics. Fixes #19854.
* Suggestions due to hlintMatthew Pickering2022-02-244-7/+3
| | | | | It turns out this job hasn't been running for quite a while (perhaps ever) so there are quite a few failures when running the linter locally.
* Generically: remove redundant Semigroup constraintsheaf2022-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | This patch removes a redundant Semigroup constraint on the Monoid instance for Generically. This constraint can cause trouble when one wants to derive a Monoid instance via Generically through a type that doesn't itself have a Semigroup instance, for example: data Point2D a = Point2D !a !a newtype Vector2D a = Vector2D { tip :: Point2D a } deriving ( Semigroup, Monoid ) via Generically ( Point2D ( Sum a ) ) In this case, we should not require there to be an instance Semigroup ( Point2D ( Sum a ) ) as all we need is an instance for the generic representation of Point2D ( Sum a ), i.e. Semigroup ( Rep ( Point2D ( Sum a) ) () ).
* (#21044) Documented arithmetic functions in base.nikshalark2022-02-134-4/+264
| | | | Didn't get it right the ninth time. Now everything's formatted correctly.
* Fix some notesMatthew Pickering2022-02-082-3/+3
|
* Fix @since annotation on NatMorrow2022-02-021-1/+1
|
* Fix a few Note inconsistenciesBen Gamari2022-02-0120-50/+55
|
* Make most shifts branchlessSylvain Henry2022-01-283-97/+106
|
* Levity-polymorphic arrays and mutable variablessheaf2022-01-262-2/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the following types levity-polymorphic in their last argument: - Array# a, SmallArray# a, Weak# b, StablePtr# a, StableName# a - MutableArray# s a, SmallMutableArray# s a, MutVar# s a, TVar# s a, MVar# s a, IOPort# s a The corresponding primops are also made levity-polymorphic, e.g. `newArray#`, `readArray#`, `writeMutVar#`, `writeIOPort#`, etc. Additionally, exception handling functions such as `catch#`, `raise#`, `maskAsyncExceptions#`,... are made levity/representation-polymorphic. Now that Array# and MutableArray# also work with unlifted types, we can simply re-define ArrayArray# and MutableArrayArray# in terms of them. This means that ArrayArray# and MutableArrayArray# are no longer primitive types, but simply unlifted newtypes around Array# and MutableArrayArray#. This completes the implementation of the Pointer Rep proposal https://github.com/ghc-proposals/ghc-proposals/pull/203 Fixes #20911 ------------------------- Metric Increase: T12545 ------------------------- ------------------------- Metric Decrease: T12545 -------------------------
* rts/winio: Fix #18382Ben Gamari2022-01-184-27/+20
| | | | | | | | | | | | | | | | | | | Here we refactor WinIO's IO completion scheme, squashing a memory leak and fixing #18382. To fix #18382 we drop the special thread status introduced for IoPort blocking, BlockedOnIoCompletion, as well as drop the non-threaded RTS's special dead-lock detection logic (which is redundant to the GC's deadlock detection logic), as proposed in #20947. Previously WinIO relied on foreign import ccall "wrapper" to create an adjustor thunk which can be attached to the OVERLAPPED structure passed to the operating system. It would then use foreign import ccall "dynamic" to back out the original continuation from the adjustor. This roundtrip is significantly more expensive than the alternative, using a StablePtr. Furthermore, the implementation let the adjustor leak, meaning that every IO request would leak a page of memory. Fixes T18382.
* winio: fix heap corruption and various leaks.Tamar Christina2022-01-152-2/+5
|
* Remove dangling references to Note [Type-checking overloaded labels]Joachim Breitner2022-01-071-3/+3
| | | | that note was removed in 4196969c53c55191e644d9eb258c14c2bc8467da
* Fix typosKrzysztof Gogolewski2021-12-253-4/+4
|
* fix ambiguity in `const` documentationalirezaghey2021-12-141-1/+1
| | | | fixes #20412
* Use HasCallStack and error in GHC.List and .NonEmptyOleg Grenrus2021-12-122-29/+28
| | | | | | | | | | | | | | | | | In addition to providing stack traces, the scary HasCallStack will hopefully make people think whether they want to use these functions, i.e. act as a documentation hint that something weird might happen. A single metric increased, which doesn't visibly use any method with `HasCallStack`. ------------------------- Metric Decrease: T9630 Metric Decrease: T19695 T9630 -------------------------
* Perf: remove allocation in writeBlocks and fix comment (#14309)Sylvain Henry2021-12-111-32/+39
|
* Re-export GHC.Types from GHC.Extssheaf2021-12-071-53/+52
| | | | | | | | | | | | | | 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
* List-monomorphic `foldr'`Viktor Dukhovni2021-12-071-9/+42
| | | | | | | | | | | | | 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-039-8/+37
| | | | | | | | | | 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.