Skip to content

Commit

Permalink
Remove redundant constraint from instance CoArbitrary Array (#65)
Browse files Browse the repository at this point in the history
We can do this now that we've dropped support for GHC 7.10
in #63.
  • Loading branch information
sjakobi authored Feb 23, 2022
1 parent 1f929eb commit 877d6ae
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Test/QuickCheck/Instances/Array.hs
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wall -fno-warn-orphans #-}
#if MIN_VERSION_base(4,9,0)
-- https://github.com/conal/checkers/pull/38
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
#endif

module Test.QuickCheck.Instances.Array where

import Test.QuickCheck
import Data.Array

-- The redundant (Ix a) constraint is required with GHC-7.10.
instance (Ix a, Integral a, Arbitrary b) => Arbitrary (Array a b) where
arbitrary =
(\x -> listArray (0,fromIntegral (length x - 1)) x) <$> arbitrary

instance (Ix a, CoArbitrary b) => CoArbitrary (Array a b) where
instance (CoArbitrary b) => CoArbitrary (Array a b) where
coarbitrary = coarbitrary . elems

0 comments on commit 877d6ae

Please sign in to comment.