squeal icon indicating copy to clipboard operation
squeal copied to clipboard

Add tuple row decoders

Open echatav opened this issue 3 years ago • 1 comments

There should be row decoders for common cases of tuples. How far up should it go? Maybe only up to quadrupleRow?

pairRow
  :: (FromValue x0 ty0, FromValue x1 ty1)
  => DecodeRow '[col0 ::: ty0, col1 ::: ty1] (x0,x1)

tripleRow
  :: (FromValue x0 ty0, FromValue x1 ty1, FromValue x2 ty2)
  => DecodeRow '[col0 ::: ty0, col1 ::: ty1, col2 ::: ty2] (x0,x1,x2)

Should there be a singleRow?

echatav avatar May 17 '22 18:05 echatav

Alternatively, a single function genericProductRow could be added. This would mirror current encoders.

genericRow / genericRowParams would match records (position and field) as decoder / encoder genericProductRow / genericParams would match products (position) including records & tuples as decoder / encoder

echatav avatar May 17 '22 19:05 echatav