Since nobody else has mentioned why there's a monomorphism restriction, I thought I'd add this bit from A History of Haskell: Being Lazy With Class.
6.2 The monomorphism restriction A major source of controversy in the early stages was the so-called “monomorphism restriction.” Suppose
that genericLength has this overloaded type:
genericLength :: Num a => [b] -> a
Now consider this definition:
f xs = (len, len)
where len = genericLength xs
It looks as if len should be computed only once, but
it can actually be computed twice. Why? Because we can infer the type
len :: (Num a) => a; when desugared with the dictionary-passing
translation, len becomes a function that is called once for each
occurrence of len, each of which might used at a different type.
Hughes argued strongly that it was unacceptable to silently duplicate
computation in this way. His argument was motivated by a program he
had written that ran exponentially slower than he expected. (This was
admittedly with a very simple compiler, but we were reluctant to make
performance differences as big as this dependent on compiler
optimisations.)
Following much debate, the committee adopted the
now-notorious monomorphism restriction. Stated briefly, it says that a
definition that does not look like a function (i.e. has no arguments on
the left-hand side) should be monomorphic in any overloaded type
variables. In this example, the rule forces len to be used at the same
type at both its occurrences, which solves the performance problem.
The programmer can supply an explicit type signature for len if
polymorphic behaviour is required.
The monomorphism restriction is
manifestly a wart on the language. It seems to bite every new Haskell
programmer by giving rise to an unexpected or obscure error message.
There has been much discussion of alternatives. The Glasgow Haskell Compiler
(GHC, Section 9.1) provides a flag:
-fno-monomorphism-restriction
to suppress the restriction altogether. But in all this time, no truly
satisfactory alternative has evolved.
I find the tone of the paper towards the monomorphism restriction is very interesting.