[Haskell-cafe] SmallCheck design question

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Mon Dec 7 18:23:18 EST 2009

referring to the Serial instances in
http://hackage.haskell.org/package/smallcheck :
the idea is that  series d  gives all objects of depth <= d.

depth of a term from an algebraic data type
is the standard "depth" concept for trees
(maximum nesting of constructors = longest path from root to node)

1. why are the tuple constructors treated differently?
I'd expect depth (x,y) = succ $ max (depth x) (depth y)
but the succ is missing.

2. why depth and not size (= total number of constructors)?
it seems that the number of objects (trees) of given depth
rises much more drastically than number of trees of given size.

just wondering - J.W.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20091207/191a5185/signature.bin

More information about the Haskell-Cafe mailing list