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

Lyle Kopnicky lists at qseep.net
Fri Aug 9 08:34:46 CEST 2013

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
    hash (VarName t n) = hash (t, n)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130808/7809dec2/attachment.htm>

More information about the Haskell-Cafe mailing list