
15 Aug
2006
15 Aug
'06
5:13 p.m.
ajb@spamcop.net wrote:
Slightly contradicting myself, here's one that I use:
class TestableProperty prop a | prop -> a where is :: prop -> a -> Bool
data Prime = Prime
instance TestableProperty Prime Integer where is Prime x = {- detail omitted -}
The only problem with this is that with the fundep, you can't do this:
instance (Integral i) => TestableProperty Prime i where is Prime x = {- same detail -}
Maybe I'm dense but couldn't you just drop the fundep? Cheers, Ben