... | ... | @@ -516,6 +516,17 @@ The `Win32` package exposes helpers that can be used to aid in supporting WINIO |
|
|
|
|
|
The `unsafeCoerce#` function has been moved from `GHC.Prim` to `Unsafe.Coerce`. As a result, attempting to import `unsafeCoerce#` from `GHC.Prim` (or `GHC.Base`, which previously re-exported `unsafeCoerce#`) will result in an error with GHC 9.0. A backwards-compatible way to fix the error is to import `unsafeCoerce#` from `GHC.Exts` instead.
|
|
|
|
|
|
`Foreign.ForeignPtr.withForeignPtr` is now no longer able to unbox its result. That is, given a program like:
|
|
|
```hs
|
|
|
readWord8 :: ForeignPtr Word8 -> IO ...
|
|
|
readWord8 fptr = do
|
|
|
W8# n <- withForeignPtr fptr $ \p -> peek p
|
|
|
...
|
|
|
```
|
|
|
GHC will now allocate, and then scrutinise, and `W8#` constructor where in previous versions it did not. This change is due to `withForeignPtr` now using the new `keepAlive#` primop (fixing #17760), across which the simplifier cannot simplify.
|
|
|
|
|
|
If you measure a significant regression in your program due to the change, the old unboxing behavior can be recovered by using `GHC.ForeignPtr.unsafeWithForeignPtr`. However, as the name suggests, this operation places an important proof obligation on the call: the action passed must not provably diverge (e.g. loop infinitely or throw an exception). Failure to ensure this can result in unsound program transformations which can result in runtime crashes (see #17760 and related tickets).
|
|
|
|
|
|
### `ghc-9.0.*`
|
|
|
|
|
|
The meaning of the `hs_fixds` field of `HsGroup` has changed slightly. It now only contains fixity signatures defined for top-level declarations and class methods defined _outside_ of the class itself. Previously, `hs_fixds` would also contain fixity signatures for class methods defined _inside_ the class, such as the fixity signature for `m` in the following example: ::
|
... | ... | @@ -532,6 +543,8 @@ If you wish to attain the previous behavior of `hs_fixds`, use the new `hsGroupT |
|
|
|
|
|
The `Unit` data type from `GHC.Tuple` has been renamed to `Solo`, per #14673/#18099.
|
|
|
|
|
|
A new primop, `keepAlive#`, has been introduced to subsume `touch#`, which cannot in general be safely transformed by the simplifier. Users of `touch#` are strongly encouraged to refactor their programs to use `keepAlive#` where possible. In the case that the program cannot use `keepAlive#` (e.g. due to values whose lifetimes don't respect lexical scoping), you are strongly encouraged to be in touch with the GHC developers to discuss alternatives.
|
|
|
|
|
|
### `integer-gmp-1.1` / `integer-simple` / `ghc-bignum-1.0`
|
|
|
|
|
|
`integer-simple` package has been removed, use `ghc-bignum` built with `native` backend instead.
|
... | ... | |