Browse Source
The way I understand it, the `Show' and `Read' instances are for `String' representations that can be Haskell code. A proper `Show' instance of `Jid' would produce something like `Jid (Just "test") "example.com" Nothing'. A proper `Read' instance of `Jid' would parse something like that `String' value, and would stop parsing when completed. This patch automatically derives the `Show' instance from `Jid'. It also uses the previous `Show' instance to create a pretty printer, `jidToText'. It also provides a (trivial) `jidToTexts'. As an automatically derived `Read' instance could be used to create invalid `Jid' values and affect the correctness of applications using Pontarius XMPP, such a derivation has not been included. This required some changes in the `Jid' marshalling code, which assumed a `Read' instance. Since we provide `jidFromText', I'm assuming that no-one needs a `Read' instance of `Jid'. Fixes #24.master
6 changed files with 43 additions and 32 deletions
Loading…
Reference in new issue