[Haskell-cafe] Data.Map

2005-04-02 Thread Gracjan Polak
Hi all, As I tried to convert some of my code to newer libraries comming with GHC 6.4, I would like to share two things with you: I noticed that there are two functions missing: deleteList and insertList. The first one is easy with foldl: deleteList list map = foldl (flip Data.Map.delete) map lis

Re: [Haskell-cafe] Ord type on lists

2005-04-02 Thread Lloyd Smith
On Apr 2, 2005 4:12 PM, Lemmih <[EMAIL PROTECTED]> wrote: > <=), (>) and (>=) are defined using 'compare', not (<). Write > 'compare' yourself and everything will be good. > But why don't you just derive Eq and Ord for List? I didn't even think of doing that. So I will say I did this way for pedago

Re: [Haskell-cafe] Ord type on lists

2005-04-02 Thread Claus Reinke
> 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 (<=),

Re: [Haskell-cafe] Ord type on lists

2005-04-02 Thread Lemmih
On Apr 3, 2005 12:41 AM, Lloyd Smith <[EMAIL PROTECTED]> wrote: > 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 impressio

[Haskell-cafe] Ord type on lists

2005-04-02 Thread Lloyd Smith
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