module Internal.Test.QuickCheck where
import Data.List.NonEmpty
( NonEmpty )
import Data.Maybe
( mapMaybe )
import Test.QuickCheck
( shrinkList )
import qualified Data.Foldable as F
import qualified Data.List.NonEmpty as NE
shrinkListNonEmpty :: (a -> [a]) -> NonEmpty a -> [NonEmpty a]
shrinkListNonEmpty :: forall a. (a -> [a]) -> NonEmpty a -> [NonEmpty a]
shrinkListNonEmpty a -> [a]
shrinkFn =
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe forall a. [a] -> Maybe (NonEmpty a)
NE.nonEmpty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (a -> [a]) -> [a] -> [[a]]
shrinkList a -> [a]
shrinkFn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) a. Foldable t => t a -> [a]
F.toList