RE: [Haskell-cafe] Typeclasses and instances

2005-05-02 Thread Simon Peyton-Jones
; haskell-cafe@haskell.org | Subject: RE: [Haskell-cafe] Typeclasses and instances | | Strange. This is a bug in GHC that crept in when I implemented GADTs. | It turns out to be slightly structural; fixing it will change the | interface-file format. So it won't get fixed in 6.4; but will in the | HEAD

RE: [Haskell-cafe] Typeclasses and instances

2005-03-18 Thread Simon Peyton-Jones
-cafe] Typeclasses and instances | | Another note, with more help from friends: | | It turns out that GHC 6.4 will let me do, | | newtype Floating a = Test a = Test [a] deriving Show | | x = Test [False, True] | | but, if I change newtype to data, it then says, | | No instance

Re: [Haskell-cafe] Typeclasses and instances

2005-03-17 Thread Mark Carroll
newtype Floating a = Vector a = Vector [a] Okay, I now know a little more about this, with help from friends. The obvious Functor instance seems not to work with GHC 6.2.2 but does work with GHC 6.4. With 6.2.2 I can still use GHC's newtype-deriving extension to derive an instance for

Re: [Haskell-cafe] Typeclasses and instances

2005-03-17 Thread Mark Carroll
Another note, with more help from friends: It turns out that GHC 6.4 will let me do, newtype Floating a = Test a = Test [a] deriving Show x = Test [False, True] but, if I change newtype to data, it then says, No instance for (Floating Bool) I'm not sure I quite

Re: [Haskell-cafe] Typeclasses and instances

2005-03-17 Thread Benjamin Franksen
On Thursday 17 March 2005 20:57, Mark Carroll wrote: Another note, with more help from friends: It turns out that GHC 6.4 will let me do, newtype Floating a = Test a = Test [a] deriving Show x = Test [False, True] but, if I change newtype to data, it then says, No

[Haskell-cafe] Typeclasses and instances

2005-03-16 Thread Mark Carroll
If I have, newtype Floating a = Vector a = Vector [a] if I want to make it an instance of Functor (with the obvious meaning), how do I write that? Thanks, Mark -- Haskell vacancies in Columbus, Ohio, USA: see http://www.aetion.com/jobs.html