Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The procedure I used to decide what types get Eq and Show instances is: If the data type is exported and has at least one data constructor: * If it is purely an enumeration (no values attached to any data constructors), it gets an Eq instance. For example CopyOutResult is not given an Eq instance because the CopyOutRow constructor has a ByteString parameter. * If its data constructors are exported, it gets a Show instance. The decision to give result data types an Eq instance is questionable: * If the Eq instance is omitted, the user is forced to handle all cases exhaustively (which is good, especially if the API changes in the future!). * If the data type is extended to include a constructor with extra data attached to it, code that used == for state comparison may unintentionally perform content comparison. However, this shouldn't be an issue if the user uses the form x == NullaryThing.
- Loading branch information