Last active
August 29, 2015 14:11
-
-
Save paf31/292a638b3b264b145ebd to your computer and use it in GitHub Desktop.
needs a better name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} | |
module Main where | |
import Test.QuickCheck | |
class Arbiter f r where | |
arbiter :: f -> Gen r | |
instance Arbiter r r where | |
arbiter = return | |
instance (Arbitrary a, Arbiter f r) => Arbiter (a -> f) r where | |
arbiter f = do | |
a <- arbitrary | |
arbiter (f a) | |
data X = X Int Int Int Int Int | |
instance Show X where | |
show _ = "X" | |
instance Arbitrary X where | |
arbitrary = arbiter X | |
main = quickCheck $ \(X _ _ _ _ _) -> True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment