Skip to content

Instantly share code, notes, and snippets.

@maoe
Created February 10, 2011 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maoe/819685 to your computer and use it in GitHub Desktop.
Save maoe/819685 to your computer and use it in GitHub Desktop.
polymorphicな高階関数をQuickCheckでテストする
{-# LANGUAGE TemplateHaskell #-}
module QCFun where
import Test.QuickCheck
import Test.QuickCheck.All
import Test.QuickCheck.Function
import Test.QuickCheck.Poly
prop_mapLength :: Fun A B -> [A] -> Bool
prop_mapLength (Fun _ f) xs = length (map f xs) == length xs
main :: IO Bool
main = $(quickCheckAll)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment