Re:Is Haskell the Cure?
by jrockway on Monday October 03, 2011 @04:16PM
(#3067841)
If the library developer can prove that a C operation is pure, why shouldn't he tell Haskell about that?
[ Parent
| on HN ]
And if you don't trust the developer, it's easy to fix his mistake:
unUnsafePerformIO :: a -> IO a
unUnsafePerformIO = returnSorry, that doesn't actually work.
ezyang@ezyang:~$ cat Test.hs
import System.IO.Unsafe
unUnsafePerformIO = return
main = do
let a = unUnsafePerformIO (unsafePerformIO (putStrLn "boom"))
a
a
ezyang@ezyang:~$ runghc Test.hs
ezyang@ezyang:~$