packages feed

aeson-openapi-record-as-tuple 0.1.0.0 → 1.0.0

raw patch · 4 files changed

+18/−7 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Aeson.RecordAsTuple: gtupleParseJSON :: forall {k1} (flds :: k1 -> Type) (k2 :: k1) {w1 :: Meta} {w2 :: Meta}. GFieldsFromJSON flds => Array -> Parser (D1 w1 (C1 w2 flds) k2)
+ Data.Aeson.RecordAsTuple: gtupleToEncoding :: forall {k1} (flds :: k1 -> Type) (k2 :: k1) {w1 :: Meta} {w2 :: Meta}. (KnownNat (ProductSize flds), GFieldsToJSON flds) => D1 w1 (C1 w2 flds) k2 -> Encoding
+ Data.Aeson.RecordAsTuple: gtupleToJSON :: forall {k1} (flds :: k1 -> Type) (k2 :: k1) {w1 :: Meta} {w2 :: Meta}. (KnownNat (ProductSize flds), GFieldsToJSON flds) => D1 w1 (C1 w2 flds) k2 -> Vector Value

Files

− CHANGELOG
@@ -1,3 +0,0 @@-0.1.0.0 - 2026-01-28 Wed-========================-Initial release
+ CHANGELOG.md view
@@ -0,0 +1,8 @@++0.1.0.0 - 2026-02-10+====================+Export gtupleToJSON, gtupleToEncoding, gtupleParseJSON++0.1.0.0 - 2026-01-28+====================+Initial release
aeson-openapi-record-as-tuple.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: aeson-openapi-record-as-tuple-version: 0.1.0.0+version: 1.0.0 build-type: Simple license: MPL-2.0 author: Michael Ledger@@ -9,7 +9,7 @@ synopsis: Encode and decode Haskell records as JSON tuples description: This package lets you derive ToJSON/FromJSON instances for record data-types that are encoded into tuples extra-doc-files:-  CHANGELOG+  CHANGELOG.md  source-repository head   type: git
src/Data/Aeson/RecordAsTuple.hs view
@@ -3,7 +3,12 @@ -- Copyright   : (c) Michael Ledger 2026 -- License     : MPL-2.0 -- Maintainer  : Michael Ledger <mike@quasimal.com>-module Data.Aeson.RecordAsTuple (RecordAsTuple (..)) where+module Data.Aeson.RecordAsTuple (+  RecordAsTuple (..),+  gtupleToJSON,+  gtupleToEncoding,+  gtupleParseJSON,+) where  import Control.Monad.ST.Strict (ST) import Data.Aeson (FromJSON, ToJSON)@@ -20,6 +25,7 @@  ) import Data.String (fromString) import Data.Typeable (Typeable, typeRep)+import Data.Vector (Vector) import Data.Vector qualified as Vector import GHC.Generics (   C1,@@ -76,7 +82,7 @@ recordSize :: forall x. (KnownNat (ProductSize x)) => Int recordSize = fromIntegral (natVal (Proxy @(ProductSize x))) -gtupleToJSON :: (KnownNat (ProductSize flds), GFieldsToJSON flds) => D1 _dt (C1 _mcons flds) k -> JSON.Array+gtupleToJSON :: (KnownNat (ProductSize flds), GFieldsToJSON flds) => D1 _dt (C1 _mcons flds) k -> Vector JSON.Value gtupleToJSON (M1 (M1 flds) :: D1 _ (C1 _ flds) _) =   Vector.fromArray     ( createArray len (error "gtupleToJSON: unitialised element") \mut -> do