; 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
-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
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
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
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
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