Here is a small program showing a problem:
import Data.Fixed
main = do
print x
where
x :: Pico
x = read "12" -- error: no instance for 'Read Pico'
I see library GHC source code in Fixed.hs – there is instance for Read (copying some code):
type Pico = Fixed E12
data E12 = E12
instance HasResolution E12 where
resolution _ = 1000000000000
instance (HasResolution a) => Read (Fixed a) where
readsPrec _ = readsFixed
What’s wrong with my reasoning and why compiler doesn’t see that Pico is instance of Read?
Fixed has a Read instance since base 4.4.0.0, which is GHC 7.2. You probably have an older version.