servant/servant-docs/src
Nickolay Kudasov 401b44ac1b Make default ToSample instances productive
The default Generics-based ToSample instance now uses Omega type
to productively produce distinct samples. The previous version
was based on lists and hence left-recursive. This means that with
previous versions the default toSamples for [Bool] would return an
infinite list like this:

[[],[False],[False,False],[False,False,False],...

As you can see it would never produce a list with True in it.
Omega handles this and produces a more diverse output:

[[],[False],[False,False],[True],...

This is still not the best possible case, but to do better we need
to use Omega not only in GToSample, but in ToSample as well since
GToSample uses ToSample instances recursively.
2015-09-19 01:25:26 +03:00
..
Servant Make default ToSample instances productive 2015-09-19 01:25:26 +03:00