Stack overflow with trivial code #68

Daniel-Diaz opened this Issue Jul 29, 2013 · 4 comments


None yet
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


tibbe commented Mar 5, 2014

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