Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Jules Bean
Try again without missing out the list... Peter Padawitz wrote: Jules Bean wrote: Incidentally, I question why the compFoo are methods. Why not just make them polymorphic functions? They don't look like you expect instances to change them. The code continues to compile if I make them

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Peter Padawitz
Jules Bean wrote: Try again without missing out the list... Peter Padawitz wrote: Jules Bean wrote: Incidentally, I question why the compFoo are methods. Why not just make them polymorphic functions? They don't look like you expect instances to change them. The code continues to compile if

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Jules Bean
Peter Padawitz wrote: What is so bad about making compFoo part of the class? It reduces the code (constraints can be avoided) and reflects the close connection between a signature Sig (implemented by the class) and the evaluation (compFoo) of Sig-terms in Sig-algebras. making it part of the

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Jules Bean
Peter Padawitz wrote: Jules Bean wrote: Peter Padawitz wrote: What is so bad about making compFoo part of the class? It reduces the code (constraints can be avoided) and reflects the close connection between a signature Sig (implemented by the class) and the evaluation (compFoo) of

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Peter Padawitz
Jules Bean wrote: Peter Padawitz wrote: Jules Bean wrote: Peter Padawitz wrote: What is so bad about making compFoo part of the class? It reduces the code (constraints can be avoided) and reflects the close connection between a signature Sig (implemented by the class) and the

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Bertram Felgenhauer
Peter Padawitz wrote: Jules Bean wrote: I don't see why! In the class class Foo a where f :: a - Int g :: b - Integer g = fromIntegral . f The equations within the class are defaults, not equations. I must admit that I didn't know this... Nevertheless, won't you agree that

Re: [Haskell-cafe] Re: type class question

2007-12-05 Thread Felipe Lessa
On Dec 5, 2007 10:38 PM, Ben Franksen [EMAIL PROTECTED] wrote: data Command = Skip class Java block command where block_ :: [command] - block compBlock :: [Command] - block --compBlock = block_ . map compCommand compCommand :: Command - command My guess is that nothing's

Re: [Haskell-cafe] Re: type class question

2007-12-05 Thread Ryan Ingram
On 12/5/07, Ben Franksen [EMAIL PROTECTED] wrote: data Command = Skip class Java block command where block_ :: [command] - block compBlock :: [Command] - block --compBlock = block_ . map compCommand compCommand :: Command - command This compiles ok. But when I ask ghci for the type of