{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.QuickCheck.Instances.Solo () where import Prelude () import Test.QuickCheck.Instances.CustomPrelude #if MIN_VERSION_OneTuple(0,4,0) import Data.Tuple.Solo (Solo (MkSolo), getSolo) #else import Data.Tuple.Solo (Solo (Solo), getSolo) #define MkSolo Solo #endif import Test.QuickCheck instance Arbitrary1 Solo where liftArbitrary :: forall a. Gen a -> Gen (Solo a) liftArbitrary = (a -> Solo a) -> Gen a -> Gen (Solo a) forall a b. (a -> b) -> Gen a -> Gen b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap a -> Solo a forall a. a -> Solo a MkSolo liftShrink :: forall a. (a -> [a]) -> Solo a -> [Solo a] liftShrink a -> [a] shr = (a -> Solo a) -> [a] -> [Solo a] forall a b. (a -> b) -> [a] -> [b] map a -> Solo a forall a. a -> Solo a MkSolo ([a] -> [Solo a]) -> (Solo a -> [a]) -> Solo a -> [Solo a] forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> [a] shr (a -> [a]) -> (Solo a -> a) -> Solo a -> [a] forall b c a. (b -> c) -> (a -> b) -> a -> c . Solo a -> a forall a. Solo a -> a getSolo instance Arbitrary a => Arbitrary (Solo a) where arbitrary :: Gen (Solo a) arbitrary = Gen (Solo a) forall (f :: * -> *) a. (Arbitrary1 f, Arbitrary a) => Gen (f a) arbitrary1 shrink :: Solo a -> [Solo a] shrink = Solo a -> [Solo a] forall (f :: * -> *) a. (Arbitrary1 f, Arbitrary a) => f a -> [f a] shrink1 instance CoArbitrary a => CoArbitrary (Solo a) where coarbitrary :: forall b. Solo a -> Gen b -> Gen b coarbitrary = a -> Gen b -> Gen b forall b. a -> Gen b -> Gen b forall a b. CoArbitrary a => a -> Gen b -> Gen b coarbitrary (a -> Gen b -> Gen b) -> (Solo a -> a) -> Solo a -> Gen b -> Gen b forall b c a. (b -> c) -> (a -> b) -> a -> c . Solo a -> a forall a. Solo a -> a getSolo instance Function a => Function (Solo a) where function :: forall b. (Solo a -> b) -> Solo a :-> b function = (Solo a -> a) -> (a -> Solo a) -> (Solo a -> b) -> Solo a :-> b forall b a c. Function b => (a -> b) -> (b -> a) -> (a -> c) -> a :-> c functionMap Solo a -> a forall a. Solo a -> a getSolo a -> Solo a forall a. a -> Solo a MkSolo