Re: [Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-06-01 Thread Greg Buchholz
Robert Dockins wrote: ] In the second instance, what you really want to say is "instance c [a] ] c, only where c is not an application of (->)". As I recall, there is ] a way to express such type equality/unequality using typeclasses, but ] I don't remember how to do it offhand. For those pla

Re: [Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-06-01 Thread Greg Buchholz
Robert Dockins wrote: > > To make this work, you're going to have to convince the compiler to accept > "overlapping instances" and then make sure they don't overlap :) In the > second instance, what you really want to say is "instance c [a] c, only where > c is not an application of (->)". As

Re: [Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-05-31 Thread Robert Dockins
On Wednesday 31 May 2006 08:22 pm, Greg Buchholz wrote: > Lately, in my quest to get a better understanding of the typeclass > system, I've been writing my typeclass instance declarations in Prolog > first, then when I've debugged them, I port them over back over to > Haskell. The porting proc

[Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-05-31 Thread Greg Buchholz
Lately, in my quest to get a better understanding of the typeclass system, I've been writing my typeclass instance declarations in Prolog first, then when I've debugged them, I port them over back over to Haskell. The porting process involves a lot trial and error on my part trying to decide w