mkDataGenM :: (MonadRandom m, Ord tc, Ord tv)
  => DataGenMap c tc tv m
  -> (DataGen' c tv m -> DataGen c tv m)
  -> tc
  -> Choice a -- ^ A @DataTree c@ with auxiliary information.
  -> (a -> DataPat c tc tv)
  -> (a -> m (DataTree c) -> m (DataTree c))
  -- ^ Use that information to update parameters (e.g., size) of recursive calls
  -> DataGen c tv m
mkDataGenM g k tc alts asTree localGen = k $ \ argGen -> do
  choose alts >>= \a -> localGen a (dataPatToGen (typedGen g argGen) (asTree a))

-- | Helper.
mkDataGenM :: (MonadRandom m, Ord tc, Ord tv)
  => DataGenMap c tc tv m
  -> (DataGen' c tv m -> DataGen c tv m)
  -> tc
  -> Choice a -- ^ A @DataTree c@ with auxiliary information.
  -> (a -> DataPat c tc tv)
  -> (a -> m (DataTree c) -> m (DataTree c))
  -- ^ Use that information to update parameters (e.g., size) of recursive calls
  -> DataGen c tv m
mkDataGenM g k tc alts asTree localGen = k $ \ argGen -> do
  choose alts >>= \a -> localGen a (dataPatToGen (typedGen g argGen) (asTree a))

-- | Helper.
mkDataGenM g k tc alts asTree localGen = k $ \ argGen -> do
  choose alts >>= \a -> localGen a (dataPatToGen (typedGen g argGen) (asTree a))

-- | Helper.