Re: ghci and ghc -threaded broken with pipes & forking

2007-03-06 Thread Simon Marlow
John Goerzen wrote: On Mon, Mar 05, 2007 at 03:20:05PM +, Ian Lynagh wrote: >From reading the docs, it sounds like forkIO keeps everything in a single OS thread/process. Doesn't this mean that a program that uses forkIO instead of forkOS loses out on SMP machines? You can use e.g. +RTS -N2

Re: ghci and ghc -threaded broken with pipes & forking

2007-03-06 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Simon, Monday, March 5, 2007, 3:59:17 PM, you wrote: my Streams library [1] don't uses this thread at all. for threads created with forkOS it provides excellent overlapping of I/O and computations (thanks, Simon, situation was *greatly* improved in 6.6). of course,

Duplicate instance declarations of a methodless class

2007-03-06 Thread mm
Hello, I was thinking that it could maybe be useful to allow duplicate instance declarations, if the class has no methods. From my naive point of view, i can not see problems, scince there are no conflicting methods to choose from. But the following program fails to be compiled by ghc-6.6: > {-#

Re: Duplicate instance declarations of a methodless class

2007-03-06 Thread Alfonso Acosta
Did you try to compile with -fallow-overlapping-instances On 3/6/07, mm <[EMAIL PROTECTED]> wrote: Hello, I was thinking that it could maybe be useful to allow duplicate instance declarations, if the class has no methods. From my naive point of view, i can not see problems, scince there are no

Re: Duplicate instance declarations of a methodless class

2007-03-06 Thread mm
On Tue, Mar 06, 2007 at 08:49:25PM +0100, Alfonso Acosta wrote: > Did you try to compile with -fallow-overlapping-instances Same effect: ghc -fallow-overlapping-instances --make test5.lhs [1 of 1] Compiling Main ( test5.lhs, test5.o ) test5.lhs:22:1: Duplicate instance declaratio

unsafePerformIO safety.

2007-03-06 Thread David Brown
I've noticed quite a few pages referencing constructs such as: var :: MVar ([Foo]) var = unsafePerformIO (newMVar ([])) and the likes. Is there a danger of different uses of 'var' getting new MVars instead of all sharing one. Having a reliable way to create a piece of global state would be

Re : HDirect and GHC-6.6

2007-03-06 Thread Fernand Lacas
Hi all, It's been a long time since I had the time to work with haskell, but I have some news about HDirect. I now succeed in compiling "ihc.exe" with the typelib support (see my previous posts on the subject), but I had to bypass the packages. That is, the second compilation stage is made usin

Re: unsafePerformIO safety.

2007-03-06 Thread Seth Kurtzberg
On Tue, 06 Mar 2007 12:03:05 -0800 David Brown <[EMAIL PROTECTED]> wrote: > I've noticed quite a few pages referencing constructs such as: > > var :: MVar ([Foo]) > var = unsafePerformIO (newMVar ([])) > > and the likes. Is there a danger of different uses of 'var' getting > new MVars inste

Re: unsafePerformIO safety.

2007-03-06 Thread David Brown
Seth Kurtzberg wrote: > On Tue, 06 Mar 2007 12:03:05 -0800 > David Brown <[EMAIL PROTECTED]> wrote: > >> I've noticed quite a few pages referencing constructs such as: >> >> var :: MVar ([Foo]) >> var = unsafePerformIO (newMVar ([])) >> >> and the likes. Is there a danger of different uses of

Re: unsafePerformIO safety.

2007-03-06 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Brown wrote: > I've noticed quite a few pages referencing constructs such as: > > var :: MVar ([Foo]) > var = unsafePerformIO (newMVar ([])) > > and the likes. Is there a danger of different uses of 'var' getting > new MVars instead of all

Re: unsafePerformIO safety.

2007-03-06 Thread Lennart Augustsson
Yeah, you really need {-# NOINLINE var #-} to make it reasonable safe. On Mar 6, 2007, at 23:18 , David Brown wrote: Seth Kurtzberg wrote: On Tue, 06 Mar 2007 12:03:05 -0800 David Brown <[EMAIL PROTECTED]> wrote: I've noticed quite a few pages referencing constructs such as: var :: MVar (

Re: Duplicate instance declarations of a methodless class

2007-03-06 Thread Matthew Brecknell
Alfonso Acosta: > Did you try to compile with -fallow-overlapping-instances mm <[EMAIL PROTECTED]>: > Same effect: > > ghc -fallow-overlapping-instances --make test5.lhs > [1 of 1] Compiling Main ( test5.lhs, test5.o ) > > test5.lhs:22:1: > Duplicate instance declarations: >

Re: unsafePerformIO safety.

2007-03-06 Thread Neil Mitchell
Hi On 3/6/07, Lennart Augustsson <[EMAIL PROTECTED]> wrote: Yeah, you really need {-# NOINLINE var #-} to make it reasonable safe. Couldn't GHC bake in knowledge about unsafePerformIO, and never inline it? It is a slightly hacky solution, but since unsafePerformIO is pretty much only used in h

Re: unsafePerformIO safety.

2007-03-06 Thread David Brown
Neil Mitchell wrote: > On 3/6/07, Lennart Augustsson <[EMAIL PROTECTED]> wrote: >> Yeah, you really need {-# NOINLINE var #-} to make it reasonable safe. > > Couldn't GHC bake in knowledge about unsafePerformIO, and never inline > it? It is a slightly hacky solution, but since unsafePerformIO is >