Re: Global variables

2007-02-02 Thread Yitzchak Gale
John Meacham wrote: luckily, pretty much all of this was worked out in a discussion a while ago, the trick was to create a new type 'ACIO' which contained only 'good' top level operations. There will be an 'unsafeIOToACIO' of course Hmm. There was a long thread about this in Nov. 2004 on haskel

Re: Global variables

2007-02-01 Thread John Meacham
On Thu, Feb 01, 2007 at 04:51:39PM +, David House wrote: > I think that's too safe-looking. Anything that translates to something > involving unsafe* should be tagged with 'unsafe' somewhere as well. > Also, as unsafe* is still compiler specific, I think a pragma is > probably most appropriate:

Re: Global variables

2007-02-01 Thread David House
(CCing the list as this is of general concern.) On 01/02/07, Yitzchak Gale <[EMAIL PROTECTED]> wrote: Why is this unsafe? What could go wrong? It could segfault due to the type safety properties that unsafePerformIO breaks: import System.IO.Unsafe import Data.IORef ref :: IORef [a] ref <- ne

Re: Global variables

2007-02-01 Thread Douglas Philips
On 2007 Feb 1, at 11:51 AM, David House indited: On 01/02/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: there is common proposal that i support. example of its use: i :: IORef Int i <- newIORef 1 with a semantics equivalent to current use of usafePerformIO +INLINE in GHC I think that's to

Re: Global variables

2007-02-01 Thread Philippa Cowderoy
On Thu, 1 Feb 2007, David House wrote: > I think that's too safe-looking. Anything that translates to something > involving unsafe* should be tagged with 'unsafe' somewhere as well. > Also, as unsafe* is still compiler specific, I think a pragma is > probably most appropriate: > > {-# GLOBAL-MUTV

Re: Global variables

2007-02-01 Thread David House
On 01/02/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: there is common proposal that i support. example of its use: i :: IORef Int i <- newIORef 1 with a semantics equivalent to current use of usafePerformIO+INLINE in GHC I think that's too safe-looking. Anything that translates to something

Re: Global variables

2007-02-01 Thread Yitzchak Gale
Hi Bulat, You wrote: there is common proposal that i support. example of its use: i :: IORef Int i <- newIORef 1 with a semantics equivalent to current use of usafePerformIO+INLINE in GHC Are the details of this posted anywhere? Is there a ticket for this? I assume you mean that this will w

Re: Global variables

2007-02-01 Thread Bulat Ziganshin
Hello Yitzchak, Thursday, February 1, 2007, 1:13:48 PM, you wrote: there is common proposal that i support. example of its use: i :: IORef Int i <- newIORef 1 with a semantics equivalent to current use of usafePerformIO+INLINE in GHC -- Best regards, Bulatmailto:[