Changed to use the prelude's conversion function realToFrac.