{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_HADDOCK not-home #-}
module GraphQL.Internal.Arbitrary
( arbitraryText
, arbitraryNonEmpty
) where
import Protolude
import qualified Data.List.NonEmpty as NonEmpty
import Data.List.NonEmpty (NonEmpty)
import qualified Data.String
import Test.QuickCheck (Gen, Arbitrary(..), arbitrary, listOf1)
arbitraryText :: Gen Text
arbitraryText = toS <$> arbitrary @Data.String.String
arbitraryNonEmpty :: forall a. Arbitrary a => Gen (NonEmpty a)
arbitraryNonEmpty =
NonEmpty.fromList <$> listOf1 arbitrary