[Haskell-cafe] Read Instance code.
Andy Stewart
lazycat.manatee at gmail.com
Sat Jul 3 07:22:39 EDT 2010
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.
------------------------------> code start <------------------------------
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]
------------------------------> code end <------------------------------
Any help?
Thanks!
-- Andy
More information about the Haskell-Cafe
mailing list