Just one more question...

data Prop = forall a b. (Eq a, Eq b, Show a, Packet b, Convertible a b)
    => Attr a b := a
       deriving (Typeable)

data Attr a b = Attr String
    (a -> Dynamic, Dynamic -> Maybe a)
    (a -> b, b -> a)

makeAttr :: (Typeable a, Convertible a b) => String -> Attr a b
makeAttr name = Attr name
                (toDyn, fromDynamic)
                (convert_AB, convert_BA)

I can do this for Attr

instance (Typeable a, Arbitrary a, Typeable b, Arbitrary b, Convertible a b) => Arbitrary (Attr a b) where
    arbitrary = makeAttr `fmap` arbitrary
    coarbitrary a = error "Not implemented"

How do I define an arbitrary prop, though? Following does not work:

arbitraryProp :: forall a b.(Arbitrary a, Arbitrary b) => Attr a b -> Gen Prop
arbitraryProp  = arbitrary := arbitrary

    Thanks, Joel

--
http://wagerlabs.com/





_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to