Re:Violating memory safety with Haskell's value restriction
by tomsmeding on Monday May 26, 2025 @10:47AM
(#44097952)
To a certain extent, the line in Haskell is: don't use unsafePerformIO and unsafeCoerce. The tricky bit is that this line is not enforced by syntax or by the type system (unlike Rust, where you have a syntactic label `unsafe`). One generally puts "unsafe" before function names that have preconditions that are not expressed in their type, but this practice is not quite always adhered to -- though the worst offenders are reliably marked "unsafe".
[ Parent
| on HN ]
Re:Violating memory safety with Haskell's value restriction
by itishappy on Monday May 26, 2025 @12:26PM
(#44098906)
There's also this classic:
accursedUnutterablePerformIO
https://hackage.haskell.org/package/bytestring-0.11.4.0/docs...
Re:Violating memory safety with Haskell's value restriction
by thesz on Monday May 26, 2025 @01:11PM
(#44099353)
> The tricky bit is that this line is not enforced by syntax or by the type system (unlike Rust, where you have a syntactic label `unsafe`).
Safe Haskell: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/safe...