{-# LANGUAGE PatternSignatures #-} module Main where import Test.QuickCheck import Test.QuickCheck.Function import Test.QuickCheck.Poly ---------------------------------------------------------------------------- prop_MapFilter (xs :: [A]) (Fun _ f) (Fun _ p) = filter p (map f xs) == map f (filter p xs) ---------------------------------------------------------------------------- prop_Fold (Fun _ f) (xs :: [A]) = not (null xs) ==> foldl1 (curry f) xs == foldr1 (curry f) xs ---------------------------------------------------------------------------- prop_Compose (x :: A) (Fun _ f) (Fun _ g) = f (g x) == g (f x) ---------------------------------------------------------------------------- prop_String (Fun _ p) = p "some long string" ==> p "some other string" ----------------------------------------------------------------------------