summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
...
* Make unsafeDupablePerformIO have a lazy demandAndreas Klebinger2021-02-061-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | When a user writes code like: unsafePerformIO $ do let x = f x writeIORef ref x return x We might expect that the write happens before we evaluate `f x`. Sadly this wasn't to case for reasons detailed in #19181. We fix this by avoiding the strict demand by turning: unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> a into unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> lazy a This makes the above code lazy in x. And ensures the side effect of the write happens before the evaluation of `f x`. If a user *wants* the code to be strict on the returned value he can simply use `return $! x`. This fixes #19181
* The Char kind (#11342)Daniel Rogozin2021-02-069-10/+102
| | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io> Implement GHC Proposal #387 * Parse char literals 'x' at the type level * New built-in type families CmpChar, ConsSymbol, UnconsSymbol * New KnownChar class (cf. KnownSymbol and KnownNat) * New SomeChar type (cf. SomeSymbol and SomeNat) * CharTyLit support in template-haskell Updated submodules: binary, haddock. Metric Decrease: T5205 haddock.base Metric Increase: Naperian T13035
* IntVar: fix allocation sizeSylvain Henry2021-02-051-1/+4
| | | | | | As found by @phadej in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4740/diffs#note_327510 Also fix FastMutInt which allocating the size in bits instead of bytes.
* Remove misleading 'lazy' pattern matches from 'head' and 'tail' in ↵wygulmage2021-02-051-2/+2
| | | | Data.List.NonEmpty
* Add missing instances to ghc-heap typesMatthew Pickering2021-02-022-8/+8
| | | | | | These instances are useful so that a `GenClosure` form `ghc-heap` can be used as a key in a `Map`. Therefore the order itself is not important but just the fact that there is one.
* Fix accidental unsoundness in Data.Typeable.Internal.mkTypeLitFromStringRyan Scott2021-02-014-1/+36
| | | | | | | | | An accidental use of `tcSymbol` instead of `tcNat` in the `TypeLitNat` case of `mkTypeLitFromString` meant that it was possible to unsafely equate `Nat` with `Symbol`. A consequence of this is that you could write `unsafeCoerce`, as observed in #19288. This is fixed easily enough, thankfully. Fixes #19288.
* Add explicit import lists to Data.List importsOleg Grenrus2021-01-293-3/+3
| | | | | | | | | | | | | Related to a future change in Data.List, https://downloads.haskell.org/ghc/8.10.3/docs/html/users_guide/using-warnings.html?highlight=wcompat#ghc-flag--Wcompat-unqualified-imports Companion pull&merge requests: - https://github.com/judah/haskeline/pull/153 - https://github.com/haskell/containers/pull/762 - https://gitlab.haskell.org/ghc/packages/hpc/-/merge_requests/9 After these the actual change in Data.List should be easy to do.
* Implement #18519Koz Ross2021-01-271-0/+38
|
* Fix doctest examples in Data.BitsOleg Grenrus2021-01-271-3/+7
|
* Remove -XMonadFailDesugaring referencesHécate2021-01-271-1/+0
|
* Add instances for GHC.Tuple.SoloBen Gamari2021-01-2711-1/+100
| | | | | | | | | | | | | | | The `Applicative` instance is the most important one (for array/vector/sequence indexing purposes), but it deserves all the usual ones. T12545 does silly 1% wibbles both ways, it seems, maybe depending on architecture. Metric Increase: T12545 Metric Decrease: T12545
* Bignum: add Natural constant folding rules (#15821)Sylvain Henry2021-01-2312-129/+187
| | | | | | | | | | | | | | | | | | | * Implement constant folding rules for Natural (similar to Integer ones) * Add mkCoreUbxSum helper in GHC.Core.Make * Remove naturalTo/FromInt We now only provide `naturalTo/FromWord` as the semantics is clear (truncate/zero-extend). For Int we have to deal with negative numbers (throw an exception? convert to Word beforehand?) so we leave the decision about what to do to the caller. Moreover, now that we have sized types (Int8#, Int16#, ..., Word8#, etc.) there is no reason to bless `Int#` more than `Int8#` or `Word8#` (for example). * Replaced a few `()` with `(# #)`
* FiniteBits for some newtype instances, notes on whyKoz Ross2021-01-231-7/+25
|
* Add headers for Data.Bits documentationKoz Ross2021-01-231-2/+3
|
* Add @since annotations for And, Ior, Xor, Iff type class instancesKoz Ross2021-01-231-9/+45
|
* Implement #15993Koz Ross2021-01-235-646/+798
|
* Change replicateM doctest exampleOleg Grenrus2021-01-221-4/+13
|
* Enhance Data instance generationSylvain Henry2021-01-221-5/+12
| | | | | | | | | | | | | | | | Use `mkConstrTag` to explicitly pass the constructor tag instead of using `mkConstr` which queries the tag at runtime by querying the index of the constructor name (a string) in the list of constructor names. Perf improvement: T16577(normal) ghc/alloc 11325573876.0 9249786992.0 -18.3% GOOD Thanks to @sgraf812 for suggesting an additional list fusion fix during reviews. Metric Decrease: T16577
* ghc-heap: Allow more control about decoding CCS fieldsMatthew Pickering2021-01-225-15/+34
| | | | | | | | We have to be careful not to decode too much, too eagerly, as in ghc-debug this will lead to references to memory locations outside of the currently copied closure. Fixes #19038
* Correct documentation in System.Mem.WeakCheng Shao2021-01-191-17/+11
| | | | | | [ci skip] Since #13167 is closed, exceptions thrown in finalizers are ignored and doesn't affect other finalizers in the same batch. This MR updates the documentation in System.Mem.Weak to reflect that.
* Rectify Haddock typos for the Functor classHécate2021-01-181-4/+5
|
* Add examples for Complex, (,,) and (,,,) Eq2 etc instancesOleg Grenrus2021-01-181-0/+51
|
* Add lifted instances for 3 and 4 tuplesOleg Grenrus2021-01-182-1/+114
|
* Add Eq1, Show1, Read1 Complex instancesOleg Grenrus2021-01-182-0/+23
|
* Bump gmp submodule, now with arm64 supportMoritz Angermann2021-01-172-31/+31
|
* Bignum: fix for Integer/Natural Ord instancesSylvain Henry2021-01-172-35/+43
| | | | | | | | | * allow `integerCompare` to inline into `integerLe#`, etc. * use `naturalSubThrow` to implement Natural's `(-)` * use `naturalNegate` to implement Natural's `negate` * implement and use `integerToNaturalThrow` to implement Natural's `fromInteger` Thanks to @christiaanb for reporting these
* Third pass on doctest corrections.Oleg Grenrus2021-01-173-11/+27
| | | | With `-K500K` rts option stack overflows are more deterministic
* Revert "Remove SpecConstrAnnotation (#13681)" (#19168)Sylvain Henry2021-01-171-2/+24
| | | | | | This reverts commit 7bc3a65b467c4286377b9bded277d5a2f69160b3. NoSpecConstr is used in the wild (see #19168)
* base: Eliminate pinned allocations from IntTableBen Gamari2021-01-173-13/+43
| | | | | | | | This replaces the ForeignPtr used to track IntTable's pointer size with a single-entry mutable ByteArray#, eliminating the fragmentation noted in #19171. Fixes #19171.
* Import fcntl with capi calling conventionOleg Grenrus2021-01-171-0/+1
| | | | See https://gitlab.haskell.org/ghc/ghc/-/issues/18854
* Remove references to ApplicativeDo in the base haddocksHécate2021-01-135-137/+106
|
* Correct more doctestsOleg Grenrus2021-01-109-20/+33
|
* Fix calls to varargs C function fcntlNick Erdmann2021-01-091-1/+2
| | | | | | The ccall calling convention doesn't support varargs functions, so switch to capi instead. See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html#varargs-not-supported-by-ccall-calling-convention
* Natural: fix left shift of 0 (fix #19170)Sylvain Henry2021-01-091-1/+2
|
* More tidy synopses, and new generative recursionViktor Dukhovni2021-01-091-69/+260
| | | | | | | | - Further correction and reconcialation with new overview of the existing synopses. Restored some "Tree" examples. - New section on generative recursion via Church encoding of lists.
* Reconcile extant synopses with new overview proseViktor Dukhovni2021-01-091-186/+323
| | | | | | | | | | | - Renamed new "update function" to "operator" from synopses - More accurate divergence conditions. - Fewer references to the Tree structure in examples, which may not have the definition close-by in context in other modules, e.g. Prelude. - Improved description of foldlM and foldrM - More detail on Tree instance construction - Misc fixes
* More truthful synopsis examplesViktor Dukhovni2021-01-091-11/+14
|
* New overview of Foldable classViktor Dukhovni2021-01-092-53/+750
| | | | Also updated stale external URL in Traversable
* Add the Data.Foldable strictness optimisations to base's changelogHécate2021-01-031-0/+3
|
* Use EmptyCase instead of undefined in Generics exampleAsad Saeeduddin2021-01-021-6/+6
| | | | Fixes #19124
* Correct doctestsOleg Grenrus2021-01-0224-38/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's simpler to assume that base is NoImplicitPrelude, otherwise running doctest on `GHC.*` modules would be tricky. OTOH, most `GHC.List` (where the most name clashes are) examples could be changed to use `import qualified Data.List as L`. (GHC.List examples won't show for Foldable methods...). With these changes majority of doctest examples are GHCi-"faithful", my WIP GHC-independent doctest runner reports nice summary: Examples: 582; Tried: 546; Skipped: 34; Success: 515; Errors: 33; Property Failures 2 Most error cases are *Hangs forever*. I have yet to figure out how to demonstrate that in GHCi. Some of divergences are actually stack overflows, i.e. caught by runtime. Few errorful cases are examples of infinite output, e.g. >>> cycle [42] [42,42,42,42,42,42,42,42,42,42... while correct, they confuse doctest. Another erroneous cases are where expected output has line comment, like >>> fmap show (Just 1) -- (a -> b) -> f a -> f b Just "1" -- (Int -> String) -> Maybe Int -> Maybe String I think I just have to teach doctest to strip comments from expected output. This is a first patch in a series. There is plenty of stuff already.
* Upstream the strictness optimisation for GHC.List.{maximum,minimum}Hécate2021-01-021-2/+2
|
* Upstream the strictness optimisation for GHC.List.{sum,product}Hécate2021-01-021-2/+2
|
* base: add Numeric.{readBin, showBin} (fix #19036)Artem Pelenitsyn2021-01-026-12/+31
|
* Add Monoid instances for Product and ComposeJoe Hermaszewski2020-12-223-0/+14
| | | | Semigroup too of course
* rts: enable thread label table in all RTS flavours #17972Adam Sandberg Ericsson2020-12-201-4/+4
|
* submodule update: containers and stmTom Ellis2020-12-172-0/+0
| | | | | | Needed for https://gitlab.haskell.org/ghc/ghc/-/issues/15656 as it stops the packages triggering incomplete-uni-patterns and incomplete-record-updates
* Revert "Implement BoxedRep proposal"Ben Gamari2020-12-1513-114/+36
| | | | | | This was inadvertently merged. This reverts commit 6c2eb2232b39ff4720fda0a4a009fb6afbc9dcea.
* Implement BoxedRep proposalAndrew Martin2020-12-1413-36/+114
| | | | | | | | | | | | | | | | | | This implements the BoxedRep proposal, refacoring the `RuntimeRep` hierarchy from: ```haskell data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ... ``` to ```haskell data RuntimeRep = BoxedRep Levity | ... data Levity = Lifted | Unlifted ``` Closes #17526.
* Implement type applications in patternsCale Gibbard2020-12-145-8/+22
| | | | | The haddock submodule is also updated so that it understands the changes to patterns.