Some library use unsafeCoerce to temporarily satisfy constraint:
class Given a where given :: a
newtype Gift a r = Gift (Given a => r)
give :: forall a r. a -> (Given a => r) -> r
give a k = unsafeCoerce (Gift k :: Gift a r) a
(This example is from reflection package. singletons package also uses this trick.)
Why is this unsafeCoerce safe?
Is there any official document which guarantee that Given a => r and a -> r have the same runtime representation in GHC?