{-# OPTIONS_GHC -fno-warn-orphans #-}

module Cursor.Forest.Gen
  (
  )
where

import Cursor.Forest
import Cursor.List.NonEmpty.Gen ()
import Cursor.Tree.Gen ()
import Data.GenValidity
import Data.GenValidity.Containers ()

instance (GenValid a, GenValid b) => GenValid (ForestCursor a b) where
  genValid :: Gen (ForestCursor a b)
genValid = NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b
forall a b.
NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b
ForestCursor (NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b)
-> Gen (NonEmptyCursor (TreeCursor a b) (CTree b))
-> Gen (ForestCursor a b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen (NonEmptyCursor (TreeCursor a b) (CTree b))
forall a. GenValid a => Gen a
genValid
  shrinkValid :: ForestCursor a b -> [ForestCursor a b]
shrinkValid (ForestCursor NonEmptyCursor (TreeCursor a b) (CTree b)
ne) = NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b
forall a b.
NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b
ForestCursor (NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b)
-> [NonEmptyCursor (TreeCursor a b) (CTree b)]
-> [ForestCursor a b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> NonEmptyCursor (TreeCursor a b) (CTree b)
-> [NonEmptyCursor (TreeCursor a b) (CTree b)]
forall a. GenValid a => a -> [a]
shrinkValid NonEmptyCursor (TreeCursor a b) (CTree b)
ne