Suppose a Haskell library designer decides to use UndecidableInstances
for some reason. The library compiles fine. Now suppose some program uses the library (like defines some instances of its type classes), but doesn't use the extension. Can it happen that the compilation fails (doesn't terminate)?
If such a scenario can happen, I'd be happy to see an example. For example, as mtl uses UndecidableInstances
a lot, is it possible to write a program that depends on mtl (or any other standard library that uses the extension), doesn't use UndecidableInstances
itself, but fails to compile because of undecidability?
class C a where f :: a -> a
andinstance C [[a]] => C [a] where f = id
, which doesn't need any other extension butUndecidableInstances
. – Lanneret