>> 2. why depth and not size (= total number of constructors)?
> That seems harder to generate terms compositionally. To create all
> terms of depth n+1 you just glue together all terms of depth n, but to
> create terms of size n+1 you need to glue 1 with n, 2 with n-1 etc.
So?
One would fear th
Hi,
I'm cc'ing the people behind smallcheck, who can give definitive answers.
> 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.
I think this was a design choice. Some people would consider:
data Foo = Fo
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)