Indeed, it is the dreaded monomorphism restriction. There are two ways around it: give explicit signature or turn this restriction off (in GHCi, you can do :set -XNoMonomorphismRestriction and you are done; language pragmas and compiler flags work as well).
–
VitusFeb 28 '12 at 22:52

Give the type checker more information. In your case we could avoid the problem by writing both bindings in one let statement. GHC can then use the type information from the second binding to correctly infer that x should have the type [Rational].

> let x = [1..]; y = 1%2 + head x
> :t x
x :: [Ratio Integer]

Disable the monomorphism restriction. This can have serious performance implications if you were expecting the type of something to be e.g. an Integer, while it is actually a Num a => a, since the latter must be recomputed each time while the former can be shared. This is the main reason why the restriction exists in the first place.

However, in the interpreter this is typically less of an issue, so the convenience is often worth it.

I strongly advise against using Ratio Int, unless you absolutely positively know that your computation cannot overflow and you are desperate for the performance - and even then I don't like it. In my opinion it was a bad mistake to make Ratio a polymorphic type, even small computations can easily exceed 64 bits, and then you get complete nonsense.
–
Daniel FischerFeb 29 '12 at 5:11