On Fri, May 9, 2008 at 3:46 PM, Achim Schneider [EMAIL PROTECTED] wrote:
Miguel Mitrofanov [EMAIL PROTECTED] wrote:
Oh, you sure?
I was, until you wrote that. But then, I am, as I wouldn't use
unsafePerformIO together with IORef's, it's giving me the creeps.
So.. what do you use
Hello Luke,
Sunday, May 11, 2008, 1:24:04 PM, you wrote:
So.. what do you use unsafePerformIO together with?
when i call function that in general case depends on the execution
order (so it's type is ...-IO x), but in my specific case it doesn't
matter. typical example is hGetContents on config
Miguel Mitrofanov [EMAIL PROTECTED] wrote:
As I understand it Haskell does not specify an order of evaluation
and it would therefore be a mistake to write a program which relies
on a particular evaluation order. This is the 'unsafe' aspect of
unsafePerformIO.
Hmm... IMHO
Oh, you sure?
quote src=http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO-Unsafe.html
It is less well known that unsafePerformIO is not type safe. For
example:
test :: IORef [a]
test = unsafePerformIO $ newIORef []
main = do
writeIORef test
Miguel Mitrofanov [EMAIL PROTECTED] wrote:
Oh, you sure?
I was, until you wrote that. But then, I am, as I wouldn't use
unsafePerformIO together with IORef's, it's giving me the creeps.
--
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All
Jon Harrop wrote:
If you have a boolean-or expression:
a || b
will a be evaluated before b in Haskell as it is in other languages?
Yes, although the meaning of the phrase evaluated before is a bit
tricky in a lazy language, so it's probably better to state it with
denotational semantics