postgresql-simple v0.1 Release Notes
Release Date: 2012-05-04 // almost 12 years ago-
Renamed several modules, typeclasses, and functions:
QueryParams (renderParams) -> ToRow (toRow) QueryResults (convertResults) -> FromRow (fromRow) Param (render) -> ToField (toField) Result (convert) -> FromField (fromField)
Added the
Database.PostgreSQL.Simple.Ok
module, a variation ofEither SomeException
that has an instance forAlternative
and also uses a list of exceptions to track the ways it has failed.Changed the return type of
fromField
andfromRow
fromEither SomeException
toOk
.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 !b <- convert fb vb return (a,b) convertResults fs vs = convertError fs vs 2 instance (FromField a, FromField b) => FromRow (a,b) where fromRow = (,) <$> field <*> field
Added
(:.)
, a pair that allows one to composeFromRow
instances:instance (FromRow a, FromRow b) => FromRow (a :. b) where fromRow = (:.) <$> fromRow <*> fromRow
Moved the contents
Field
module into theFromField
module.Removed the
RawResult
type.Added
DefaultIsolationLevel
as a distinctIsolationLevel
option andDefaultReadWriteMode
as a distinctReadWriteMode
.