22 Jan
2026
22 Jan
'26
1:54 p.m.
On Wed, Jan 21, 2026 at 11:14:49PM +0000, Tom Ellis wrote:
could I coerce `f x` to `Any x`? (assuming f maps lifted types to lifted types)
Coincidentally, Andreas Klebinger posted something today on a ghc-proposals discussion:
It's also worth pointing out that GHC gives no guarantees that unsafeCoerce is safe for anything beyond casting from/to `Any`
Maybe that's evidence that casting from/to `Any x` is *not* OK? (I don't think what Andreas said can *literally* be correct, because surely it's safe to unsafeCoerce from a to b when `Coercible a b` is in scope?) Tom