Idea from https://gist.github.com/Icelandjack/e1ddefb0d5a79617a81ee98c49fbbdc4
Works great for concrete types
data A = MkA
instance (Eq & Ord & Show & Arbitrary) A where
(==) :: A -> A -> Bool
MkA == MkA = True
compare :: A -> A -> Ordering
MkA `compare` MkA = EQ
show :: A -> String
show MkA = "MkA"
arbitrary :: Gen A
arbitrary = pure MkA
It could be magic... (inferred from methods, and then crushed together) or determined from explicit instance sigs (and then crushed)
and the methods have the same constraints as provided, and the instances become