Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove a 'unsafeCoerce' from 'Unsafe.coerce' (#330)
Previously, the linear `Unsafe.coerce` was implemented using two `unsafeCoerce`'s, one to get a function `a -> b`, and another one to cast that function to be a linear one. After the unsafe equality proofs change[1], we have a `unsafeEqualityProof` function to cast two types to be the same without looking at the value, so we can linearly return it, removing the need for the outer `unsafeCoerce`. This removes one allocation from the generated STG code for 'Data.Array.Unlifted.get', improving the performance slightly. [1]: https://gitlab.haskell.org/ghc/ghc/-/commit/74ad75e87317196c600dfabc61aee1b87d95c214
- Loading branch information