Skip to content
Browse files

Documentation tweaks

  • Loading branch information...
1 parent 7921281 commit 1bda1d8b7ef32a01b073138647bd21fa014f58de @lpsmith committed
Showing with 30 additions and 25 deletions.
  1. +18 −18 CHANGES
  2. +12 −7 src/Database/PostgreSQL/Simple.hs
View
36 CHANGES
@@ -1,4 +1,4 @@
-Version 0.1:
+Version 0.1: (2012-05-04)
* Renamed several modules, typeclasses, and functions:
QueryParams (renderParams) -> ToRow (toRow)
@@ -6,19 +6,19 @@ Version 0.1:
Param (render) -> ToField (toField)
Result (convert) -> FromField (fromField)
- * Added the Database.PostgreSQL.Simple.Ok module
-
+ * Added the `Database.PostgreSQL.Simple.Ok` module, a variation of
+ `Either SomeException` that has an instance for `Alternative` and also
+ uses a list of exceptions to track the ways it has failed.
+
* Changed the return type of `fromField` and `fromRow` from
- `Either SomeException` to `Ok`. Either doesn't have an instance for
- Alternative, and an orphaned instance inside of postgresql-simple is a
- very bad idea. Also, Ok returns a list of Exceptions so that you can
- see all the ways it has failed.
-
- * Thanks to Ozgun Ataman, the "FromRow" typeclass has been massively
- improved. The result is simpler definitions and better compositionality.
- Also, user-defined instances need not be to be concerned about forcing
- the converted results, as
-
+ `Either SomeException` to `Ok`.
+
+ * Thanks to suggestions from Ozgun Ataman, the `FromRow` typeclass has been
+ massively improved. The result is simpler definitions and better
+ compositionality. Also, user-defined instances need not be to be
+ concerned about forcing the converted results to WHNF. Here is an
+ example comparing the old to the new:
+
instance (Result a, Result b) => QueryResults (a,b) where
convertResults [fa,fb] [va,vb] = do
!a <- convert fa va
@@ -29,14 +29,14 @@ Version 0.1:
instance (FromField a, FromField b) => FromRow (a,b) where
fromRow = (,) <$> field <*> field
- * Added :., a pair that allows one to compose "FromRow" instances:
-
+ * Added `(:.)`, a pair that allows one to compose `FromRow` instances:
+
instance (FromRow a, FromRow b) => FromRow (a :. b) where
fromRow = (:.) <$> fromRow <*> fromRow
- * Moved the contents Field module into the "FromField" module.
+ * Moved the contents `Field` module into the `FromField` module.
* Removed the `RawResult` type.
- * Added `DefaultIsolationLevel` as a distinct `IsolationLevel` option and
- `DefaultReadWriteMode as a distinct `ReadWriteMode` option.
+ * Added `DefaultIsolationLevel` as a distinct `IsolationLevel` option
+ and `DefaultReadWriteMode` as a distinct `ReadWriteMode`.
View
19 src/Database/PostgreSQL/Simple.hs
@@ -504,23 +504,28 @@ ellipsis bs
-- | Of the four isolation levels defined by the SQL standard,
-- these are the three levels distinguished by PostgreSQL as of version 9.0.
-- See <http://www.postgresql.org/docs/9.1/static/transaction-iso.html>
--- for more information.
+-- for more information. Note that prior to PostgreSQL 9.0, 'RepeatableRead'
+-- was equivalent to 'Serializable'.
data IsolationLevel
= DefaultIsolationLevel -- ^ the isolation level will be taken from
-- PostgreSQL's per-connection
- -- @default_transaction_isolation@ variable.
+ -- @default_transaction_isolation@ variable,
+ -- which is initialized according to the
+ -- server's config. The default configuration
+ -- is 'ReadCommitted'.
| ReadCommitted
| RepeatableRead
- | Serializable -- ^ Note that prior to PostgreSQL 9.0,
- -- @Serializable@ was equivalent to
- -- @RepeatableRead@.
+ | Serializable
deriving (Show, Eq, Ord, Enum, Bounded)
data ReadWriteMode
- = DefaultReadWriteMode -- ^ the isolation level will be taken from the
+ = DefaultReadWriteMode -- ^ the read-write mode will be taken from
-- PostgreSQL's per-connection
- -- @default_transaction_read_only@ variable.
+ -- @default_transaction_read_only@ variable,
+ -- which is initialized according to the
+ -- server's config. The default configuration
+ -- is 'ReadWrite'.
| ReadWrite
| ReadOnly
deriving (Show, Eq, Ord, Enum, Bounded)

0 comments on commit 1bda1d8

Please sign in to comment.
Something went wrong with that request. Please try again.