The line
transformers ==0.4.* && ==0.5.2.0
is a dependency constraint on the version of the transformers library. Here it states that it requires that the transformers version is at the same time 0.4.* and 0.5.2.0.
Although there can be different versions installed, during compilation only one version can be used—therefore, this constraint can never be satisfied.
For some reasons, cabal seems to get confused with the two revisions of the mtl package.
The second revision adds support for transformers-5. See also issue 30 of mtl, where it is noted that the metadata of hackage is the second revision, but the source tarball that is finally downloaded is the original revision.
Until a new version of mtl is released, you have to explicitly install transformers-0.4.3.0 (and only that version) and then install mtl.
cabal install transformers-0.4.3.0
If the dependencies are satisfied when installing mtl, transformers-0.4.3.0 will pass the dependency check.
It seems that cabal automatically adds the latest version as a dependency (e.g. == transformers-0.5.2.0
) when that version is installed. Therefore, only 0.4.* versions should be installed.
If you have already installed the latest transformers version, you can uninstall it:
ghc-pkg unregister --force transformers-0.5.2.0
rm -r .cabal/packages/hackage.haskell.org/transformers/0.5.2.0
(Do this for every 5.x version that is installed, see cabal info transformers
for a list of installed version.)