genericArbitrary is probably unusable for recursive data structures. When writing a generator for a recursive structure you need to reduce the size at each level of the structure so that it will stop generating at some point. Also the generator itself needs to be sized to ensure that the size state is observed .
Run into the same problem myself the other day. Substituting immediate recursive part with fix point solved it for me:
import Control.Lazy (fix)
import Data.NonEmpty ((:|))
import Test.QuickCheck.Arbitrary (class Arbitrary)
import Test.QuickCheck.Gen (oneOf)
data T a
= Leaf a
| V (T a)
| B (T a) (T a)
instance arbT :: Arbitrary a => Arbitrary (T a) where
arbitrary = fix $ \p -> oneOf (hd :| tl p)
where
hd = Leaf <$> arbitrary
tl p = [V <$> p, B <$> p <*> p]