on dev help sign in
fix tests
24a6387Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+2−2
@@ -349,7 +349,7 @@ instance (SListI tys, IsProductType x xs, AllZip ToNullityParam xs tys)
349-- a PostgreSQL `PGType` into a Haskell `Type`.
349-- a PostgreSQL `PGType` into a Haskell `Type`.
350class FromValue (pg :: PGType) (y :: Type) where
350class FromValue (pg :: PGType) (y :: Type) where
351 -- | >>> newtype Id = Id { getId :: Int16 } deriving Show
351 -- | >>> newtype Id = Id { getId :: Int16 } deriving Show
352− -- >>> instance FromValue 'PGint2 Id where fromValue = fmap Id . fromValue
352+ -- >>> instance FromValue 'PGint2 Id where fromValue = Id <$> fromValue @'PGint2
353 fromValue :: Decoding.Value y
353 fromValue :: Decoding.Value y
354instance FromValue 'PGbool Bool where fromValue = Decoding.bool
354instance FromValue 'PGbool Bool where fromValue = Decoding.bool
355instance FromValue 'PGint2 Int16 where fromValue = Decoding.int
355instance FromValue 'PGint2 Int16 where fromValue = Decoding.int
@@ -484,7 +484,7 @@ class SListI result => FromRow (result :: RelationType) y where
484 -- | >>> :set -XOverloadedStrings
484 -- | >>> :set -XOverloadedStrings
485 -- >>> import Data.Text
485 -- >>> import Data.Text
486 -- >>> newtype UserId = UserId { getUserId :: Int16 } deriving Show
486 -- >>> newtype UserId = UserId { getUserId :: Int16 } deriving Show
487− -- >>> instance FromValue 'PGint2 UserId where fromValue = fmap UserId . fromValue
487+ -- >>> instance FromValue 'PGint2 UserId where fromValue = UserId <$> fromValue @'PGint2
488 -- >>> data UserRow = UserRow { userId :: UserId, userName :: Maybe Text } deriving (Show, GHC.Generic)
488 -- >>> data UserRow = UserRow { userId :: UserId, userName :: Maybe Text } deriving (Show, GHC.Generic)
489 -- >>> instance Generic UserRow
489 -- >>> instance Generic UserRow
490 -- >>> instance HasDatatypeInfo UserRow
490 -- >>> instance HasDatatypeInfo UserRow