
11 Sep
2011
11 Sep
'11
6:21 p.m.
I see this has been answered, but since someone else may be learning too I thought I would share. I have always used deriving for Read so I was unsure. This post gave me the push to go hunt it down. A very quick grep for "instance Read" in the ghc lib sources and I found: instance Read Int64 where readsPrec p s = [(fromInteger x, r) | (x, r) <- readsPrec p s] In the Int.hs source. The other ints are similar. So like Daniel I ended up with a definition based on reads once I experimented quickly.