
On Thu, Feb 19, 2015 at 12:13 PM,
From: Tom Ellis
To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Testing polymorphic properties with QuickCheck
I'm not quite sure what you're asking specifically, but maybe this will help:
{-# LANGUAGE ScopedTypeVariables #-}
monoid_suite :: forall m. (Eq m, Monoid m) => String -> Proxy m -> TestTree monoid_suite typename _ = testGroup "monoid" [ testProperty ("left additive identity (" ++ typename ++ ")") (prop_left_add_id :: m -> Bool),
... <other general monoid properties here> ]
monoid_suite_integer :: TestTree monoid_suite_integer = monoid_suite "Integer" (Proxy :: Integer)
Please excuse my ignorance as a relatively new Haskell user but is there anything special about that "Proxy m" type? Thanks, Stu