The information in LYAH is old. The release notes for GHC 7.4.1 say that:
The Num class no longer has Eq or Show superclasses.
You will need to write,
foo :: (Num x, Show x) => x -> String
(In fact, the foo you wrote doesn't require Num x, so you can omit that to avoid an unnecessary constraint.)