summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* Bump binary submoduleBen Gamari2021-05-061-0/+0
| | | | Fixes #19631.
* Use fix-sized arithmetic primops for fixed size boxed typesJohn Ericson2021-05-063-108/+239
| | | | | | | | | | | We think the compiler is ready, so we can do this for all over the 8-, 16-, and 32-bit boxed types. We are holding off on doing all the primops at once so things are easier to investigate. Metric Decrease: T12545
* Update documentation of 'Weak'bit2021-05-031-8/+7
|
* Move shift ops out of GHC.BaseSylvain Henry2021-05-033-66/+72
| | | | | | | With a quick flavour I get: before T12545(normal) ghc/alloc 8628109152 after T12545(normal) ghc/alloc 8559741088
* Use fix-sized bit-fiddling primops for fixed size boxed typesJohn Ericson2021-05-033-80/+145
| | | | | Like !5572, this is switching over a portion of the primops which seems safe to use.
* Redesign withDict (formerly magicDict)Ryan Scott2021-04-298-28/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a more precise type signature to `magicDict` as proposed in #16646. In addition, this replaces the constant-folding rule for `magicDict` in `GHC.Core.Opt.ConstantFold` with a special case in the desugarer in `GHC.HsToCore.Expr.dsHsWrapped`. I have also renamed `magicDict` to `withDict` in light of the discussion in https://mail.haskell.org/pipermail/ghc-devs/2021-April/019833.html. All of this has the following benefits: * `withDict` is now more type safe than before. Moreover, if a user applies `withDict` at an incorrect type, the special-casing in `dsHsWrapped` will now throw an error message indicating what the user did incorrectly. * `withDict` can now work with classes that have multiple type arguments, such as `Typeable @k a`. This means that `Data.Typeable.Internal.withTypeable` can now be implemented in terms of `withDict`. * Since the special-casing for `withDict` no longer needs to match on the structure of the expression passed as an argument to `withDict`, it no longer cares about the presence or absence of `Tick`s. In effect, this obsoletes the fix for #19667. The new `T16646` test case demonstrates the new version of `withDict` in action, both in terms of `base` functions defined in terms of `withDict` as well as in terms of functions from the `reflection` and `singletons` libraries. The `T16646Fail` test case demonstrates the error message that GHC throws when `withDict` is applied incorrectly. This fixes #16646. By adding more tests for `withDict`, this also fixes #19673 as a side effect.
* Fix inlining of division wrappersSylvain Henry2021-04-291-0/+18
|
* Make divModInt# branchlessSylvain Henry2021-04-292-24/+69
|
* Allow divInt#/modInt# to inline (#18067)Sylvain Henry2021-04-291-2/+2
|
* Refactor modInt# to make it branchlessSylvain Henry2021-04-291-7/+59
|
* Refactor divInt# to make it branchless (#18067, #19636)Sylvain Henry2021-04-291-9/+68
|
* Add documentation for GHC.Exts.sortWithiori tsu2021-04-271-0/+5
| | | | | | sortWith has the same type definition as `Data.List.sortOn` (eg: `Ord b => (a -> b) -> [a] -> [a]`). Nonetheless, they behave differently, sortOn being more efficient. This merge request add documentation to reflect on this differences
* Eliminate unsafeEqualityProof in CorePrepSimon Peyton Jones2021-04-261-23/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main idea here is to avoid treating * case e of {} * case unsafeEqualityProof of UnsafeRefl co -> blah specially in CoreToStg. Instead, nail them in CorePrep, by converting case e of {} ==> e |> unsafe-co case unsafeEqualityProof of UnsafeRefl cv -> blah ==> blah[unsafe-co/cv] in GHC.Core.Prep. Now expressions that we want to treat as trivial really are trivial. We can get rid of cpExprIsTrivial. And we fix #19700. A downside is that, at least under unsafeEqualityProof, we substitute in types and coercions, which is more work. But a big advantage is that it's all very simple and principled: CorePrep really gets rid of the unsafeCoerce stuff, as it does empty case, runRW#, lazyId etc. I've updated the overview in GHC.Core.Prep, and added Note [Unsafe coercions] in GHC.Core.Prep Note [Implementing unsafeCoerce] in base:Unsafe.Coerce We get 3% fewer bytes allocated when compiling perf/compiler/T5631, which uses a lot of unsafeCoerces. (It's a happy-generated parser.) Metric Decrease: T5631
* Add Eq1 and Ord1 Fixed instancesOleg Grenrus2021-04-262-1/+11
|
* Enable tables next to code for riscv64Andreas Schwab2021-04-191-0/+9
| | | | | This requires adding another rewrite to the mangler, to avoid generating PLT entries.
* Use correct precedence in Complex's Read1/Show1 instancesRyan Scott2021-04-184-3/+50
| | | | Fixes #19719.
* Data.List strictness optimisations for maximumBy and minimumByHécate Moonlight2021-04-141-14/+21
| | | | follow-up from !4675
* Report actual port in libiserv:Remote.Slave.startSlaveFacundo Domínguez2021-04-101-1/+2
| | | | | | This allows to start iserv by passing port 0 to startSlave, which in turns allows to get an available port when no port is known to be free a priori.
* Implement list `fold` and `foldMap` via mconcatKoz Ross2021-04-106-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This allows specialized mconcat implementations an opportunity to combine elements efficiently in a single pass. - Inline the default implementation of `mconcat`, this may result in list fusion. - In Monoids with strict `mappend`, implement `mconcat` as a strict left fold: * And (FiniteBits) * Ior (FiniteBits) * Xor (FiniteBits) * Iff (FiniteBits) * Max (Ord) * Min (Ord) * Sum (Num) * Product (Num) * (a -> m) (Monoid m) - Delegate mconcat for WrappedMonoid to the underlying monoid. Resolves: #17123 Per the discussion in !4890, we expect some stat changes: * T17123(normal) run/alloc 403143160.0 4954736.0 -98.8% GOOD This is the expected improvement in `fold` for a long list of `Text` elements. * T13056(optasm) ghc/alloc 381013328.0 447700520.0 +17.5% BAD Here there's an extra simplifier run as a result of the new methods of the Foldable instance for List. It looks benign. The test is a micro benchmark that compiles just the derived foldable instances for a pair of structures, a cost of this magnitude is not expected to extend to more realistic programs. * T9198(normal) ghc/alloc 504661992.0 541334168.0 +7.3% BAD This test regressed from 8.10 and 9.0 back to exponential blowup. This metric also fluctuates, for reasons not yet clear. The issue here is the exponetial blowup, not this MR. Metric Decrease: T17123 Metric Increase: T9198 T13056
* Bignum: add BigNat Eq/Ord instances (#19647)Sylvain Henry2021-04-091-0/+16
|
* Change foldl' to inline when partially applied (#19534)James Foster2021-04-072-17/+66
| | | | | And though partially applied foldl' is now again inlined, #4301 has not resurfaced, and appears to be resolved.
* Bignum: remove unused extra filesSylvain Henry2021-04-051-2/+0
|
* Bignum: fix invalid hs-boot declaration (#19638)Sylvain Henry2021-04-051-1/+1
|
* Fixes Monad's associativity docsŁukasz Gołębiewski2021-04-051-1/+1
| | | | | | It is incorrectly displayed in hackage as: `m1 <*> m2 = m1 >>= (x1 -> m2 >>= (x2 -> return (x1 x2)))` which isn't correct Haskell
* Address review feedback on chiralityViktor Dukhovni2021-04-011-11/+45
| | | | Also added nested foldr example for `concat`.
* Chiral foldable caveatsViktor Dukhovni2021-04-011-3/+37
|
* libiserv: Add descriptionBen Gamari2021-04-011-2/+2
|
* ghc-boot: Use cabal-version: 3.0Ben Gamari2021-04-011-2/+3
|
* ghc-bignum: Add missing source files to cabal fileBen Gamari2021-04-011-0/+2
|
* Data.List specialization to []Oleg Grenrus2021-04-0117-1609/+1360
| | | | | | | - Remove GHC.OldList - Remove Data.OldList - compat-unqualified-imports is no-op - update haddock submodule
* Add -Wcompat to hadrianOleg Grenrus2021-03-312-0/+0
| | | | Update submodules haskeline and hpc
* Additionally export asum from Control.ApplicativeOleg Grenrus2021-03-302-1/+4
| | | | Fixes #19575
* Allocate Adjustors and mark them readable in two stepsMoritz Angermann2021-03-293-1/+20
| | | | | | | | | This drops allocateExec for darwin, and replaces it with a alloc, write, mark executable strategy instead. This prevents us from trying to allocate an executable range and then write to it, which X^W will prohibit on darwin. This will *only* work if we can use mmap.
* Make RULES more robust in GHC.FloatSimon Peyton Jones2021-03-281-75/+155
| | | | | | | | | | | | | The RULES that use hand-written specialised code for overloaded class methods like floor, ceiling, truncate etc were fragile to certain transformations. This patch makes them robust. See #19582. It's all described in Note [Rules for overloaded class methods]. No test case because currently we don't do the transformation (floating out over-saturated applications) that makes this patch have an effect. But we may so so in future, and this patch makes the RULES much more robust.
* Bump Win32 to 2.13.0.0GHC GitLab CI2021-03-264-0/+0
| | | | Bumps Win32 submodule.
* Add compiler linting to CIHécate2021-03-251-1/+0
| | | | | This commit adds the `lint:compiler` Hadrian target to the CI runner. It does also fixes hints in the compiler/ and libraries/base/ codebases.
* base: Use mutableByteArrayContentsBen Gamari2021-03-223-13/+11
|
* Bump template-haskell version to 2.18.0.0wip/T19083Ryan Scott2021-03-204-2/+2
| | | | | | | This requires bumping the `exceptions` and `text` submodules to bring in commits that bump their respective upper version bounds on `template-haskell`. Fixes #19083.
* Move miscategorized items in template-haskell changelogRyan Scott2021-03-201-6/+6
|
* Clean up TBDs in changelogBen Gamari2021-03-201-1/+7
| | | | (cherry picked from commit 4f334120c8e9cc4aefcbf11d99f169f648af9fde)
* Fix fake import in GHC.Exception.Type boot moduleSylvain Henry2021-03-205-23/+22
| | | | | | | | | It seems like I imported "GHC.Types ()" thinking that it would transitively import GHC.Num.Integer when I wrote that module; but it doesn't. This led to build failures. See https://mail.haskell.org/pipermail/ghc-devs/2021-March/019641.html
* Add more boundary checks for `rem` and `mod`John Ericson2021-03-201-18/+44
| | | | | | | | | | | | | | | | | It's quite backend-dependent whether we will actually handle that case right, so let's just always do this as a precaution. In particular, once we replace the native primops used here with the new sized primops, the 16-bit ones on x86 will begin to use 16-bit sized instructions where they didn't before. Though I'm not sure of any arch which has 8-bit scalar instructions, I also did those for consistency. Plus, there are *vector* 8-bit ops in the wild, so if we ever got into autovectorization or something maybe it's prudent to put this here as a reminder not to forget about catching overflows. Progress towards #19026
* Generate GHCi bytecode from STG instead of Core and support unboxedLuite Stegeman2021-03-201-1/+1
| | | | | | tuples and sums. fixes #1257
* [skip ci] Fix 'Ord' documentation inconsistencyGaël Deest2021-03-201-4/+4
| | | | | | | | | | | | | | | | | | | Current documentation for the `Ord` typeclass is inconsistent. It simultaneously mentions that: > The 'Ord' class is used for totally ordered datatypes. And: > The Haskell Report defines no laws for 'Ord'. However, '<=' is > customarily expected to implement a non-strict partial order […] The Haskell report (both 98 and 2010 versions) mentions total ordering, which implicitly does define laws. Moreover, `compare :: Ord a => a -> a -> Ordering` and `data Ordering = LT | EQ | GT` imply that the order is indeed total (there is no way to say that two elements are not comparable). This MR fixes the Haddock comment, and adds a comparability law to the list of suggested properties.
* Built-in type families: CharToNat, NatToChar (#19535)Vladislav Zavialov2021-03-172-0/+16
| | | | | Co-authored-by: Daniel Rogozin <daniel.rogozin@serokell.io> Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io>
* fromInteger :: Integer -> {Float,Double} now always round to nearest evenARATA Mizuki2021-03-174-21/+56
| | | | | | | | integerToFloat# and integerToDouble# were moved from ghc-bignum to base. GHC.Integer.floatFromInteger and doubleFromInteger were removed. Fixes #15926, #17231, #17782
* [ci] Skip test's on windows that often fail in CI.wip/angerman/stable-windowsMoritz Angermann2021-03-161-1/+2
|
* Implement the UnliftedDatatypes extensionSebastian Graf2021-03-142-1/+3
| | | | | | | | | | | | | | | | | | GHC Proposal: 0265-unlifted-datatypes.rst Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265 Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523 Implementation Details: Note [Implementation of UnliftedDatatypes] This patch introduces the `UnliftedDatatypes` extension. When this extension is enabled, GHC relaxes the restrictions around what result kinds are allowed in data declarations. This allows data types for which an unlifted or levity-polymorphic result kind is inferred. The most significant changes are in `GHC.Tc.TyCl`, where `Note [Implementation of UnliftedDatatypes]` describes the details of the implementation. Fixes #19523.
* Update win32 submoduleTamar Christina2021-03-121-0/+0
|
* testsuite: Update Win32 test output for GHC2021GHC GitLab CI2021-03-111-0/+0
| | | | Fixes the Windows CI jobs. Requires update of the Win32 submodule.