git.iko.soy/typeable/postgresql-simple
on master help sign in
Add a semblance of documentation for new FromRow instances
commit08d03e3a579ab2a4a1b3ca5b928d2e7b28d86e87 authorLeon P Smith <leon@melding-monads.com> dateSun 27 Oct 2013, 23:34 (13 years ago) parentd6eef36
1 file changed+8−6
src/Database/PostgreSQL/Simple/FromRow.hs+8−6
src/Database/PostgreSQL/Simple/FromRow.hs+8−6
@@ -12,7 +12,10 @@
1212-- returned by a SQL query into a more useful Haskell representation.
1313--
1414-- Predefined instances are provided for tuples containing up to ten
15−-- elements.
15+-- elements. The instances for 'Maybe' types return 'Nothing' if all
16+-- the columns that would have been otherwise consumed are null, otherwise
17+-- it attempts a regular conversion.
18+--
1619------------------------------------------------------------------------------
1720
1821module Database.PostgreSQL.Simple.FromRow
@@ -26,11 +29,14 @@ module Database.PostgreSQL.Simple.FromRow
2629import Prelude hiding (null)
2730import Control.Applicative (Applicative(..), (<$>), (<|>), (*>))
2831import Control.Monad (replicateM, replicateM_)
32+import Control.Monad.Trans.State.Strict
33+import Control.Monad.Trans.Reader
34+import Control.Monad.Trans.Class
2935import Data.ByteString (ByteString)
3036import qualified Data.ByteString.Char8 as B
3137import Data.Vector (Vector)
3238import qualified Data.Vector as V
33−import Database.PostgreSQL.Simple.Types (Only(..))
39+import Database.PostgreSQL.Simple.Types (Only(..))
3440import qualified Database.PostgreSQL.LibPQ as PQ
3541import Database.PostgreSQL.Simple.Internal
3642import Database.PostgreSQL.Simple.Compat
@@ -39,10 +45,6 @@ import Database.PostgreSQL.Simple.Ok
3945import Database.PostgreSQL.Simple.Types ((:.)(..), Null)
4046import Database.PostgreSQL.Simple.TypeInfo
4147
42−import Control.Monad.Trans.State.Strict
43−import Control.Monad.Trans.Reader
44−import Control.Monad.Trans.Class
45−
4648-- | A collection type that can be converted from a sequence of fields.
4749-- Instances are provided for tuples up to 10 elements and lists of any length.
4850--