[Haskell] duplicate elements in Data.Set

2006-01-21 Thread Walter Moreira
Hello list. Are there situations where a set can contain duplicate elements? I have a newtype and it is an instance of 'Eq' via the 'compare' method, and it is also an instance of 'Ord'. After some Data.Set operations with sets of that type I get a set which contains two elements which compare eq

Re: [Haskell] duplicate elements in Data.Set

2006-01-22 Thread Till Mossakowski
The problem probably is that your Ord instance does not define a total order. Below a small example exhibiting the same problem. This shows the usefulness of specification of Haskell programs (e.g. with Programatica or HasCASL) - verification could be used to detect such problems. Till module