6

With this fragment, and smallcheck-1.0.1

data Foo = A | B | Pair Foo Foo deriving Show
deriving instance Generic Foo
instance (Monad m) => Serial m Foo

then this

list 1 (series :: Series Identity Foo)

generates an apparently infinite list.

Something that I thought was equivalent until smallcheck-0.6.1 generates only [A,B] and is what I would expect.

Is this an intended change to smallcheck Series, and if so, is there an easy way to get back the 0.6.1 behaviour.

There are compilable programs to demonstrate this here: http://hpaste.org/83927

Ben Clifford
  • 1,398
  • 1
  • 12
  • 23

1 Answers1

5

Definitely a bug — thanks for reporting. I've just uploaded v1.0.2 which fixes it.

Additionally, I've recorded an issue as a reminder to test Generic instances.

Roman Cheplyaka
  • 37,738
  • 7
  • 72
  • 121