[Haskell-cafe] Doctest, quickcheck and typeclass
Gautier DI FOLCO
gautier.difolco at gmail.com
Mon Jul 14 16:39:22 UTC 2014
Is there a way, with doctest and quickcheck, to declare test at typeclass
level (such as laws) and play them automatically at instance level?
-- | Convert from/to a List to/from an arbitrary data structure
-- >>> prop > fromList . toList == id
class Listable d where
fromList :: [a] -> d a
toList :: d a -> [a]
And this test will be played for each instance.
Thanks in advance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe