@@ -436,22 +436,16 @@ instance
436 -- <value: <length> bytes>
436 -- <value: <length> bytes>
437 -- [end if]
437 -- [end if]
438 -- [end for]
438 -- [end for]
440− :: forall pgs. SListI pgs
441− => Strict.ByteString
442− -> Either Strict.Text (NP (K (Maybe Strict.ByteString)) pgs)
443 composite = Decoding.valueParser $ do
439 composite = Decoding.valueParser $ do
444 unitOfSize 4
440 unitOfSize 4
445− let
441+ hsequence' $ hpure $ Comp $ do
447− unitOfSize 4
442+ unitOfSize 4
448− len <- sized 4 Decoding.int
443+ len <- sized 4 Decoding.int
449− if len == -1
444+ if len == -1
450− then return (K Nothing)
445+ then return (K Nothing)
451− else K . Just <$> bytesOfSize len
446+ else K . Just <$> bytesOfSize len
452− htraverse' each (hpure Proxy :: NP Proxy pgs)
454− Decoding.fn (fromRow @fields @y <=< composite)
448+ Decoding.fn (fromRow @fields <=< composite)
456-- | A `FromField` constraint lifts the `FromValue` parser
450-- | A `FromField` constraint lifts the `FromValue` parser
457-- to a decoding of a @(Symbol, NullityType)@ to a `Type`,
451-- to a decoding of a @(Symbol, NullityType)@ to a `Type`,
@@ -466,13 +460,13 @@ instance FromValue pg y
466 fromField = Comp . \case
460 fromField = Comp . \case
467 K Nothing -> Left "fromField: saw NULL when expecting NOT NULL"
461 K Nothing -> Left "fromField: saw NULL when expecting NOT NULL"
468 K (Just bytestring) -> P <$>
462 K (Just bytestring) -> P <$>
469− Decoding.valueParser (fromValue @pg @y) bytestring
463+ Decoding.valueParser (fromValue @pg) bytestring
470instance FromValue pg y
464instance FromValue pg y
471 => FromField (column ::: 'Null pg) (column ::: Maybe y) where
465 => FromField (column ::: 'Null pg) (column ::: Maybe y) where
472 fromField = Comp . \case
466 fromField = Comp . \case
473 K Nothing -> Right $ P Nothing
467 K Nothing -> Right $ P Nothing
474 K (Just bytestring) -> P . Just <$>
468 K (Just bytestring) -> P . Just <$>
475− Decoding.valueParser (fromValue @pg @y) bytestring
469+ Decoding.valueParser (fromValue @pg) bytestring
477-- | A `FromRow` constraint generically sequences the parsings of the columns
471-- | A `FromRow` constraint generically sequences the parsings of the columns
478-- of a `RelationType` into the fields of a record `Type` provided they have
472-- of a `RelationType` into the fields of a record `Type` provided they have