RE: Confused about default

2001-12-17 Thread Simon Peyton-Jones
Well, Foo *is* an instance of Num, so a correct Haskell impl should pick that instance always. Since you don't define the fromInteger method in the instance decl, you get a runtime error. I don't know what you expect the [Foo] and Foo - Int defaults to do. GHCi fails to put the correct default

Re: Confused about default

2001-12-17 Thread Ian Lynagh
On Mon, Dec 17, 2001 at 08:57:28AM -0800, Simon Peyton-Jones wrote: Well, Foo *is* an instance of Num, so a correct Haskell impl should pick that instance always. I was looking at what the implementations would allow, the module wasn't supposed to be useful. Since you don't define the