Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generics Series Generating Infinite List

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

like image 783
Ben Clifford Avatar asked Mar 12 '13 18:03

Ben Clifford


1 Answers

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.

like image 195
Roman Cheplyaka Avatar answered Oct 14 '22 19:10

Roman Cheplyaka