Are safe coercions safe in the sense of Safe Haskell?

Wolfgang Jeltsch g9ks157k at
Fri Aug 15 20:04:29 UTC 2014


I would expect the function

    coerce :: Coercible a b => a -> b

to be safe in the sense of Safe Haskell. However, the Data.Coerce module
is marked “Unsafe”. The coerce function is also available via GHC.Exts
and GHC.Prim. The former module is marked “Unsafe”, but the latter is
(surprisingly) marked “Safe-Inferred”.

What are the reasons behind this?

All the best,

More information about the Glasgow-haskell-users mailing list