
Andy Stewart
Hi all,
I have some incorrect "Read instance" make i got error "Prelude.read: no parse", and i don't know how to fix it.
newtype SerializedWindow = SerializedWindow (Maybe DrawWindow)
instance Show SerializedWindow where show _ = "SerializedWindow Nothing"
instance Read SerializedWindow where readsPrec _ str = [(SerializedWindow Nothing, idStr) | (val :: String, idStr) <- reads str]
Try using Derive or DrIFT to generate a proto-typical instance for you, and then hack that and make it neater. If you don't care about cross-compiler compatability, using ReadP rather than ReadS also results in nicer parsing code. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com