[Haskell-cafe] Question on Coerce

Georgi Lyubenov godzbanebane at gmail.com
Wed Dec 2 15:24:33 UTC 2020


You can only coerce between types that guaranteedly have the same runtime
representation (newtypes), and "structures of them". Look up Coercible for
more information.

In this case, there is no way to know that two arbitrary types a and b have
the same representation, so you can't coerce between them.

=======
Georgi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201202/a4ec1a24/attachment.html>


More information about the Haskell-Cafe mailing list