{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.QuickCheck.Instances.CaseInsensitive () where
import Prelude ()
import Test.QuickCheck.Instances.CustomPrelude
import Test.QuickCheck
import qualified Data.CaseInsensitive as CI
instance (CI.FoldCase a, Arbitrary a) => Arbitrary (CI.CI a) where
arbitrary :: Gen (CI a)
arbitrary = a -> CI a
forall s. FoldCase s => s -> CI s
CI.mk (a -> CI a) -> Gen a -> Gen (CI a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen a
forall a. Arbitrary a => Gen a
arbitrary
shrink :: CI a -> [CI a]
shrink = (a -> CI a) -> [a] -> [CI a]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> CI a
forall s. FoldCase s => s -> CI s
CI.mk ([a] -> [CI a]) -> (CI a -> [a]) -> CI a -> [CI a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> [a]
forall a. Arbitrary a => a -> [a]
shrink (a -> [a]) -> (CI a -> a) -> CI a -> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CI a -> a
forall s. CI s -> s
CI.original
instance CoArbitrary a => CoArbitrary (CI.CI a) where
coarbitrary :: CI a -> Gen b -> Gen b
coarbitrary = a -> Gen b -> Gen b
forall a b. CoArbitrary a => a -> Gen b -> Gen b
coarbitrary (a -> Gen b -> Gen b) -> (CI a -> a) -> CI a -> Gen b -> Gen b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CI a -> a
forall s. CI s -> s
CI.original
instance (CI.FoldCase a, Function a) => Function (CI.CI a) where
function :: (CI a -> b) -> CI a :-> b
function = (CI a -> CI (CI a))
-> (CI (CI a) -> CI a) -> (CI a -> b) -> CI a :-> b
forall b a c.
Function b =>
(a -> b) -> (b -> a) -> (a -> c) -> a :-> c
functionMap CI a -> CI (CI a)
forall s. FoldCase s => s -> CI s
CI.mk CI (CI a) -> CI a
forall s. CI s -> s
CI.original