@@ -473,14 +473,6 @@ instance
473473-- decoding `Null`s to `Maybe`s. You should not define instances for
474474-- `FromColumnValue`, just use the provided instances.
475475class FromColumnValue (pg :: (Symbol, NullityType)) (y :: (Symbol, Type)) where
476− -- | >>> :set -XTypeOperators -XOverloadedStrings
477− -- >>> newtype Id = Id { getId :: Int16 } deriving Show
478− -- >>> instance FromValue 'PGint2 Id where fromValue = fmap Id . fromValue
479− -- >>> fromColumnValue @("col" ::: 'NotNull 'PGint2) @Id (K (Just "\NUL\SOH"))
480− -- Id {getId = 1}
481− --
482− -- >>> fromColumnValue @("col" ::: 'Null 'PGint2) @(Maybe Id) (K (Just "\NUL\SOH"))
483− -- Just (Id {getId = 1})
484476 fromColumnValue
485477 :: K (Maybe Strict.ByteString) pg
486478 -> (Either Strict.Text :.: P) y
@@ -512,7 +504,7 @@ class SListI result => FromRow (result :: RelationType) y where
512504 -- >>> instance HasDatatypeInfo UserRow
513505 -- >>> type User = '["userId" ::: 'NotNull 'PGint2, "userName" ::: 'Null 'PGtext]
514506 -- >>> fromRow @User @UserRow (K (Just "\NUL\SOH") :* K (Just "bloodninja") :* Nil)
515− -- UserRow {userId = UserId {getUserId = 1}, userName = Just "bloodninja"}
507+ -- Right (UserRow {userId = UserId {getUserId = 1}, userName = Just "bloodninja"})
516508 fromRow :: NP (K (Maybe Strict.ByteString)) result -> Either Strict.Text y
517509instance
518510 ( SListI result
@@ -532,7 +524,7 @@ instance
532524-- K (Just "foo") :* Nil
533525--
534526-- >>> fromRow @'["fromOnly" ::: 'Null 'PGtext] @(Only (Maybe Text)) (K (Just "bar") :* Nil)
535−-- Only {fromOnly = Just "bar"}
527+-- Right (Only {fromOnly = Just "bar"})
536528newtype Only x = Only { fromOnly :: x }
537529 deriving (Functor,Foldable,Traversable,Eq,Ord,Read,Show,GHC.Generic)
538530instance Generic (Only x)