[Haskell-cafe] unique id for data types

2007-09-18 Thread Barney Hilken
In order to make my records system practically useable, I need a type family type family NameCmp n m which totally orders datatypes. More precisely, it should return one of the following types: data NameLT = NameLT data NameEQ = NameEQ data NameGT = NameGT for each pair

Re: [Haskell-cafe] unique id for data types

2007-09-18 Thread Neil Mitchell
Hi Barney, This may be of interest, since all types already have an Int associated with them: http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#v%3AtypeRepKey Thanks Neil On 9/18/07, Barney Hilken [EMAIL PROTECTED] wrote: In order to make my records system

Re: [Haskell-cafe] unique id for data types

2007-09-18 Thread Barney Hilken
Hi Neil, thanks for the response. The problem is this: It is in the IO monad because the actual value of the key may vary from run to run of the program (taken from the web page). Since I'm relying on the order, not just equality, this will seriously screw things up, because my records are