mirror of
https://github.com/mrkkrp/megaparsec.git
synced 2024-12-25 01:07:57 +03:00
Fix building with QuickCheck older than 2.9.0
This commit is contained in:
parent
0367967161
commit
e6c5c2beed
@ -175,15 +175,20 @@ instance ( Show t
|
||||
instance (Arbitrary t, Ord t, Arbitrary e, Ord e)
|
||||
=> Arbitrary (ParseError t e) where
|
||||
arbitrary = ParseError
|
||||
<$>
|
||||
#if !MIN_VERSION_QuickCheck(2,9,0)
|
||||
(NE.fromList . getNonEmpty <$> arbitrary)
|
||||
#if MIN_VERSION_QuickCheck(2,9,0)
|
||||
<$> arbitrary
|
||||
#else
|
||||
arbitrary
|
||||
<$> (NE.fromList . getNonEmpty <$> arbitrary)
|
||||
#endif
|
||||
#if MIN_VERSION_QuickCheck(2,8,2)
|
||||
<*> arbitrary
|
||||
<*> arbitrary
|
||||
<*> arbitrary
|
||||
#else
|
||||
<*> (E.fromList <$> arbitrary)
|
||||
<*> (E.fromList <$> arbitrary)
|
||||
<*> (E.fromList <$> arbitrary)
|
||||
#endif
|
||||
|
||||
-- | Merge two error data structures into one joining their collections of
|
||||
-- message items and preferring longest match. In other words, earlier error
|
||||
|
@ -72,6 +72,12 @@ import qualified Data.Set as E
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.Lazy as TL
|
||||
|
||||
#if !MIN_VERSION_QuickCheck(2,8,2)
|
||||
instance (Arbitrary a, Ord a) => Arbitrary (E.Set a) where
|
||||
arbitrary = E.fromList <$> arbitrary
|
||||
shrink = fmap E.fromList . shrink . E.toList
|
||||
#endif
|
||||
|
||||
spec :: Spec
|
||||
spec = do
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user