[Haskell-cafe] deriving Data.HashTable - stack overflow
Lyle Kopnicky
lists at qseep.net
Thu Aug 8 18:22:45 CEST 2013
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 datatype:
http://hackage.haskell.org/packages/archive/hashable/latest/doc/html/Data-Hashable.html
The problem occurs even when using the sample code on the page:
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics (Generic)
import Data.Hashable
data Colour = Red | Green | Blue
deriving Generic
instance Hashable Colour
If I then type `hash Red` I get a stack overflow.
I am using the Haskell Platform, so I have hashable-1.1.2.5, but I notice
the docs are for hashable-1.2.0.10. If I install 1.2.0.10 though, other
code in my project breaks - seems like one part doesn't recognize the
instances from another part. So I'll stick with the platform version.
I am running the 32-bit Windows GHC 7.6.3. Haskell Platform 2013.2.0.0.
Any thoughts?
Thanks,
Lyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130808/e727924c/attachment.htm>
More information about the Haskell-Cafe
mailing list