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 where
    hash (VarName t n) = hash (show t ++ n)

Not super-efficient, but it'll be fine. The printString function (defined
in that other package) uses a single character prefix for each ValType.

- Lyle
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to