Why does one need to explicitly write checks (possibly using quickcheck) for type class laws in Haskell?
For example for testing associativity of the String monoid:
leftIdcheck :: Monoid a => a -> Bool
leftIdcheck a = a <> mempty == a
quickCheck (leftIdcheck :: String -> Bool)
But this is so much work! Why can't the haskell complier just check all this by default on its own and tell me that my instance of monoid on my type doesn't satisfy the identity law ?
Is there any library or language extension that allows us to have these checks built in as we write the program instead of having to write them separately? This seems very error prone.
On a related note, does Agda let us have these checks/proofs for free or do we have to write them manually there too?