
Hi everyone, I defined my own list datatype and then tried to declare it as an instance of type class Ord. However when I test it with
Nil > Cons 1(Nil) I get an "ERROR - Control stack overflow"
I am under the impression that the ord class defines default implementations of (<=), (>),(>=) so that I only have to supply the implementation of (<) shown below. Can some one tell me why this does not work the way I expect it to?
Now, whereever did that interpretation come from?-) The library docs are pretty clear about what constitutes a minimal definition: http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3A... Have a closer look at Ord and its default definitions to see what happens in your case: http://www.haskell.org/onlinereport/basic.html#sect6.3.2 hth, claus