The source for the State transformer in mtl states:
-- ---------------------------------------------------------------------------
-- Instances for other mtl transformers
--
-- All of these instances need UndecidableInstances,
-- because they do not satisfy the coverage condition.
What is the “coverage condition”? All I can tell is that it has something to do with MTPCs and fundeps.
Section 7.6.3.2 of the GHC manual tells us what the coverage condition is:
In plain English, this means that if you have a type class with fundeps, for example:
you can define the following instances:
but not the following instances: