Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Stack overflow with trivial code #68

Daniel-Diaz opened this Issue · 4 comments

3 participants


The code below gives me stack overflow when evaluating foo in GHCi.

{-# LANGUAGE DeriveGeneric #-}

import GHC.Generics
import Data.Hashable
import Data.HashSet

data Foo = Foo deriving (Eq, Generic)

instance Hashable Foo

foo = member Foo empty

Is this expected?

GHCi version 7.6.3.
unordered-containers version


GHCi version 7.6.3
unordered-containers version

stack overflow, too



hash Foo
also stack overflow, so I think this is a bug of hashable Foo


instance Hashable Foo where
hash Foo = 1

will be okay


So the problem is most likely with Generic deriving. Unfortunately I don't know that code well as I didn't write it, so it'll take a bit longer until I get to it. Any extra debug info (e.g. what does the derived code look like) would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.