News for hackers. Stuff that matters.
Re:Is Haskell the Cure? by danieldk on Monday October 03, 2011 @01:49PM (#3067254)
Explain? What would the alternative be?

Box the value that is the result of evaluation an expression that calls impure code in IO?

This is what I'd expect for calling impure code in third-party libraries.

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?
Re:Is Haskell the Cure? by jrockway on Tuesday October 04, 2011 @12:06AM (#3069307)
And if you don't trust the developer, it's easy to fix his mistake:

    unUnsafePerformIO :: a -> IO a
    unUnsafePerformIO = return
Re:Is Haskell the Cure? by ezyang on Tuesday October 04, 2011 @02:32AM (#3069677)
Sorry, 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:~$
Re:Is Haskell the Cure? by jrockway on Tuesday October 04, 2011 @11:07AM (#3071209)
Yes, true. Patch the library if the annotation is wrong :)