Skip to content

Comment on Haskell Is Exceptionally Unsafe parent

Comments

Indeed, this problem has absolutely nothing to do with exceptions, other than that exceptions require the Typeable typeclass. I suspect the author only roped exceptions into his exposition to give him an excuse for that linkbaity title.

The problem isn't even caused by Typeable itself per se, it's caused by wilfully ignoring that you're not meant to define an instance of it manually, you're meant to tell the compiler to derive one automatically. As far as I'm aware, writing your own Typeable instance causes undefined behaviour according to the very specification of the typeclass.

So, yes, Haskell's types are unsafe, if you deliberately go out of your way to subvert them. I'm left wondering... "So what?"

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.