I created my own myzipWith function and want to compare it with the original zipWith with the use of quickCheck.
myzipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
myzipWith a y [] = []
myzipWith a [] y = []
myzipWith a (x:xs) (z:zs) = [a x z] ++ myzipWith a xs zs
prop_zip x y z = myzipWith x y z == zipWith x y z
When I run quickCheck by typing quickCheck prop_zip, it returns error:
<interactive>:69:1: error:
* No instance for (Show (a0 -> b0 -> c0))
arising from a use of `quickCheck'
(maybe you haven't applied a function to enough arguments?)
* In the expression: quickCheck prop_zip
In an equation for `it': it = quickCheck prop_zip
<interactive>:69:12: error:
* Ambiguous type variable `c0' arising from a use of `prop_zip'
prevents the constraint `(Eq c0)' from being solved.
Probable fix: use a type annotation to specify what `c0' should be.
These potential instances exist:
instance (Eq b, Eq a) => Eq (Either a b)
-- Defined in `Data.Either'
instance Eq Ordering -- Defined in `GHC.Classes'
instance Eq Integer
-- Defined in `integer-gmp-1.0.0.1:GHC.Integer.Type'
...plus 23 others
...plus 73 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
* In the first argument of `quickCheck', namely `prop_zip'
In the expression: quickCheck prop_zip
In an equation for `it': it = quickCheck prop_zip
What is the propblem here?