> In Haskell, when I read an API, I know no effects lurk behind the pure type signatures.
I wonder how often unsafePerformIO : IO 'a -> 'a is employed
I wonder how often unsafePerformIO : IO 'a -> 'a is employed
To answer you directly, I've read code in various Haskell packages, everything from mime to snap, and AFAICT, it is typically used when you need to call a C library. Suppose you need to use OpenSSL's digest algorithms, for example. Because we technically don't know whether or not that library will have effects, we have to use unsafePerformIO.
Most languages have `unsafePerformIO` on every single computation :-)