Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-09 Thread Lyle Kopnicky
Ah, thanks, folks! I'll just implement my own hashing by generating a string and calling the hash function on that. That's what I was doing in the old version of my code, anyway. It's just that in the core Data.HashTable, you had to provide a hash function, so the point where I used the hash

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-09 Thread Lyle Kopnicky
I chose not to introduce another dependency. I just implemented the hash function by delegating to the Show instance of the nested type: data ValType = FloatType | IntType | StringType deriving (Show,Eq) data VarName = VarName ValType String deriving (Show,Eq) instance Hashable VarName

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-09 Thread Lyle Kopnicky
Here's another way to do it: data ValType = FloatType | IntType | StringType deriving (Show,Eq) instance Hashable ValType where hash FloatType = 0 hash IntType = 1 hash StringType = 2 data VarName = VarName ValType String deriving (Show,Eq) instance Hashable VarName where

[Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-08 Thread Lyle Kopnicky
Hi folks, In GHC 7.6.3, the base Data.HashTable is deprecated, so I installed the hashtables package. In order to work on your datatype, you need an instance of Data.Hashable.Hashable. So I went to the Data.Hashable page and looked up examples on how to derive a Hashable instance for my

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-08 Thread Joey Adams
On Thu, Aug 8, 2013 at 12:22 PM, Lyle Kopnicky li...@qseep.net wrote: ... So I went to the Data.Hashable page and looked up examples on how to derive a Hashable instance for my datatype: http://hackage.haskell.org/packages/archive/hashable/latest/doc/html/Data-Hashable.html The problem

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-08 Thread David Thomas
I do wish there was a compiler-checked way of specifying a minimum complete definition. On Thu, Aug 8, 2013 at 11:02 AM, Joey Adams joeyadams3.14...@gmail.comwrote: On Thu, Aug 8, 2013 at 12:22 PM, Lyle Kopnicky li...@qseep.net wrote: ... So I went to the Data.Hashable page and looked up

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-08 Thread Erik Hesselink
There is a ticket with discussion and a patch here [0]. Erik [0] http://ghc.haskell.org/trac/ghc/ticket/7633 On Thu, Aug 8, 2013 at 8:11 PM, David Thomas davidleotho...@gmail.com wrote: I do wish there was a compiler-checked way of specifying a minimum complete definition. On Thu, Aug 8,