So, once again i have tried to specify variables in functions, but it didn`t help.
functions:
> prop_unzip_check :: forall a b. Ord a => [(a,b)] -> Bool
> prop_unzip_check xs = length (unzip (xs::[(a,b)])) >= 0
and
> prop_merge_check :: forall a. Ord a => [a] -> [a] -> Bool
> prop_merge_check xs ys = length (merge (xs::[a]) (ys::[a])) == length (sort ((xs::[a]) ++ (ys::[a])))
And after compiling i receive this confusing error:
Test property "prop_merge_check" ... aborted. Reason: Ambiguous type variable
a0' arising from a use of
quickCheckBool' prevents the constraint(Arbitrary a0)' from being solved. Probable fix: use a type annotation to specify what
a0' should be. These potential instances exist: instance Arbitrary QCGen -- Defined inTest.QuickCheck.Arbitrary' instance Arbitrary (a b c) => Arbitrary (WrappedArrow a b c) -- Defined in
Test.QuickCheck.Arbitrary' instance Arbitrary (m a) => Arbitrary (WrappedMonad m a) -- Defined inTest.QuickCheck.Arbitrary' ...plus 80 others (use -fprint-potential-instances to see them all) Ambiguous type variable
a0' arising from a use ofprop_merge_check' prevents the constraint
(Ord a0)' from being solved. Probable fix: use a type annotation to specify whata0' should be. These potential instances exist: instance Ord (Encoding' a) -- Defined in
Data.Aeson.Encoding.Internal' instance Ord DotNetTime -- Defined inData.Aeson.Types.Internal' instance Ord JSONPathElement -- Defined in
Data.Aeson.Types.Internal' ...plus 310 others (use -fprint-potential-instances to see them all)
Aucun commentaire:
Enregistrer un commentaire