3 ms·
Data.Dynamic is type safe. It performs a run-time type check. Haskell can be made to be unsound using 'unsafeCoerce', but as you'll note, there is a giant unsa
by tathougies 8y ago
Data.Dynamic is type safe. It performs a run-time type check.
Haskell can be made to be unsound using 'unsafeCoerce', but as you'll note, there is a giant unsafe in front of it.
- chowells 8y agoHaskell is unsound because of 'undefined :: a'. There you go - a proof of every proposition by the Curry-Howard isomorphism. It's still safe, though, as it diverges at run time. Much like the ClassCastException coming from the JVM prevents the unsoundness in the original article from being a safety error. 'unsafeCoerce' (and things that can implement it, like creating a polymorphic mutable cell with 'unsafePerformIO') are worse than unsound - they are also unsafe.