| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first change makes the array ones use the proper fixed-size types,
which also means that just like before, they can be used without
explicit conversions with the boxed sized types. (Before, it was Int# /
Word# on both sides, now it is fixed sized on both sides).
For the second change, don't use "extend" or "narrow" in some of the
user-facing primops names for conversions.
- Names like `narrowInt32#` are misleading when `Int` is 32-bits.
- Names like `extendInt64#` are flat-out wrong when `Int is
32-bits.
- `narrow{Int,Word}<N>#` however map a type to itself, and so don't
suffer from this problem. They are left as-is.
These changes are batched together because Alex happend to use the array
ops. We can only use released versions of Alex at this time, sadly, and
I don't want to have to have a release thatwon't work for the final GHC
9.2. So by combining these we get all the changes for Alex done at once.
Bump hackage state in a few places, and also make that workflow slightly
easier for the future.
Bump minimum Alex version
Bump Cabal, array, bytestring, containers, text, and binary submodules
|
|
|
|
|
|
|
| |
Add Data.Type.Ord
Add and update tests
Metric Increase:
MultiLayerModules
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider (`T18610`):
```hs
f :: Bool -> Int
f x = case (x, x) of
(True, True) -> 1
(False, False) -> 2
(True, False) -> 3 -- Warning: Redundant
```
The third clause will be flagged as redundant. Nevertheless, the
programmer might intend to keep the clause in order to avoid bitrot.
After this patch, the programmer can write
```hs
g :: Bool -> Int
g x = case (x, x) of
(True, True) -> 1
(False, False) -> 2
(True, False) | GHC.Exts.considerAccessible -> 3 -- No warning
```
And won't be bothered any longer. See also `Note [considerAccessible]`
and the updated entries in the user's guide.
Fixes #18610 and #19228.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So that we don't get a silly worker `$wdivModInt` and risk inlining
`divModInt#` into `divModInt` or `$wdivModInt`, making both unlikely to
inline at call sites.
Fixes #19267.
There's a spurious metric decrease (was an *increase*) in T12545. That
seems entirely due to shifts in Unique distribution (+5% more
`IntMap.$winsert` calls). The inappropriateness of the acceptance window
is tracked in #19414.
Metric Decrease:
T12545
Metric Increase:
T12545
|
| |
|
|
|
|
|
|
|
|
|
| |
When desugaring large overloaded literals we now avoid
computing the `Rational` value. Instead prefering to
store the significant and exponent as given where
reasonable and possible.
See Note [FractionalLit representation] for details.
|
|
|
|
|
|
|
| |
It should be left to tooling to perform the filtering to remove these
specific closure types from the profile if desired.
Fixes #16795
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using -fdicts-strict we generate references to absentError while
compiling ghc-prim. However we always load ghc-prim before base so this
caused linker errors.
We simply solve this by moving absentError into ghc-prim. This does mean
it's now a panic instead of an exception which can no longer be caught.
But given that it should only be thrown if there is a compiler error
that seems acceptable, and in fact we already do this for
absentSumFieldError which has similar constraints.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was revealed in #19363 that the Template Haskell pretty-printer implemented
in `Language.Haskell.TH.Ppr` did not pretty-print infix names or symbolic names
correctly in certain situations, such as in data constructor declarations or
fixity declarations. Easily fixed by using `pprName' Applied` (which always
parenthesizes symbolic names in prefix position) or `pprName' Infix` (which
always surrounds alphanumeric names with backticks in infix position) in the
right spots.
Fixes #19363.
|
| |
|
|
|
|
| |
The COMPLETE pragma was not properly terminated with a '#-}'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* `openFile` could sometimes leak file descriptors if it
received an asynchronous exception (#19114, #19115). Fix this
on POSIX.
* `openFile` and more importantly `openFileBlocking` could not
be interrupted effectively during the `open` system call (#17912).
Fix this on POSIX.
* Implement `readFile'` using `withFile` to ensure the file is closed promptly on exception.
* Avoid `bracket` in `withFile`, reducing the duration of masking.
Closes #19130.
Addresses #17912, #19114, and #19115 on POSIX systems, but not
on Windows.
|
|
|
|
|
|
|
| |
As pointed in #19284, previously the order was a bit confusing.
This didn't affect the meaning but nevertheless it's much clearer now.
Closes #19284.
|
|
|
|
| |
closes #19365
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #5972. This adds an extension NoFieldSelectors to disable the generation
of selector functions corresponding to record fields. When this extension is
enabled, record field selectors are not accessible as functions, but users are
still able to use them for record construction, pattern matching and updates.
See Note [NoFieldSelectors] in GHC.Rename.Env for details.
Defining the same field multiple times requires the DuplicateRecordFields
extension to be enabled, even when NoFieldSelectors is in use.
Along the way, this fixes the use of non-imported DuplicateRecordFields in GHCi
with -fimplicit-import-qualified (fixes #18729).
Moreover, it extends DisambiguateRecordFields to ignore non-fields when looking
up fields in record updates (fixes #18999), as described by
Note [DisambiguateRecordFields for updates].
Co-authored-by: Simon Hafner <hafnersimon@gmail.com>
Co-authored-by: Fumiaki Kinoshita <fumiexcel@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Teach it to use unsafeWithForeignPtr where appropriate.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Fix the following rule:
"fromIntegral/Int->Natural" fromIntegral = naturalFromWord . fromIntegral
Its type wasn't constrained to Int hence #19345.
|
|
|
|
|
| |
They have no effect since 2011 (GHC 7.2/7.4),
commits cb698570b2b and 49dbe60558.
|
|
|
|
|
|
| |
Bumps the binary and deepseq submodules.
Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/15028.
|
|
|
|
|
|
|
| |
I think it is worth to say that closeFd is interruptible by asynchronous
exceptions.
And also fix indentation of closeFd_.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
closeFdWith is accessing shared TMVar - the IO manager callbak table
var. It might be concurrently used by different threads: either becuase
it contains information about different file descriptors or a single
file descriptor is accessed from different threads. For this reason
`takeMVar` might block, although for a very short time as all the
IO operations are using epoll (or its equivalent).
This change makes hClose and Network.Socket.close safe in presence of
asynchronous exceptions. This is especailly important in the context of
`bracket` which expects uninterruptible close handler.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Data.List.NonEmpty
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 `(# #)`
|
| |
|