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

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 using

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 instead of

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 'var' getting

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: instance

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

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 pretty