Frames-beam 0.1.0.2 → 0.2.0.0
raw patch · 3 files changed
+21/−12 lines, 3 filesdep ~Framesdep ~vinylPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Frames, vinyl
API changes (from Hackage documentation)
- Frames.SQL.Beam.Postgres.Vinylize: createRecId :: GenericVinyl a names rs => a -> Rec Identity (ZipTypes names rs)
+ Frames.SQL.Beam.Postgres.Vinylize: createRecId :: GenericVinyl a names rs => a -> Rec ElField (ZipTypes names rs)
Files
- CHANGELOG.md +10/−1
- Frames-beam.cabal +5/−5
- src/Frames/SQL/Beam/Postgres/Vinylize.hs +6/−6
CHANGELOG.md view
@@ -1,3 +1,12 @@-# 0.1.0.0+# 0.2.0.0+Support for `Frames-0.5.0` and `vinyl-0.10.0`. +Also see [issue #19](https://github.com/gagandeepb/Frames-beam/issues/19). +# 0.1.0.2+Adds dependency upper-bounds for `Frames` and `vinyl` ++# 0.1.0.1+Removes upper-bounds for most dependencies++# 0.1.0.0 Initial version
Frames-beam.cabal view
@@ -1,5 +1,5 @@ name: Frames-beam-version: 0.1.0.2+version: 0.2.0.0 synopsis: A library for accessing Postgres tables as in-memory data structures. description: This library provides a way to access Postgres tables as data frames by providing helpers for generating @@ -37,10 +37,10 @@ , beam-migrate >=0.3.2.1 , text >=1.2.3.0 , postgresql-simple >=0.5.3.0- , Frames >=0.3.0.2 && <0.5+ , Frames >=0.5 && <0.6 , template-haskell >=2.12.0.0 , generics-sop >=0.3.2.0- , vinyl >=0.7.0 && <0.9+ , vinyl >=0.10 && <0.11 , process >=1.6.1.0 , conduit >=1.3.0.2 , monad-control >=1.0.2.3 @@ -67,8 +67,8 @@ , conduit >=1.3.0.2 , generics-sop >=0.3.2.0 , text >=1.2.3.0- , vinyl >=0.7.0 && <0.9- , Frames >=0.3.0.2 && <0.5+ , vinyl >=0.10 && <0.11+ , Frames >=0.5 && <0.6 , beam-core >=0.7.2.1 , beam-postgres >=0.3.2.0 , beam-migrate >=0.3.2.1
src/Frames/SQL/Beam/Postgres/Vinylize.hs view
@@ -22,15 +22,15 @@ import Language.Haskell.TH -- | Type family that generates the column types for the vinyl representation.-type family ZipTypes (ns :: [Symbol]) (ys :: [*]) = (zs :: [k]) | zs -> ns ys+type family ZipTypes (ns :: [Symbol]) (ys :: [*]) = (zs :: [(Symbol, *)]) | zs -> ns ys type instance ZipTypes '[] '[] = '[]-type instance ZipTypes (n ': ns) (y ': ys) = ( n :-> y) ': (ZipTypes ns ys)+type instance ZipTypes (n ': ns) (y ': ys) = '( n, y) ': (ZipTypes ns ys) -- | Typeclass for converting a plain Haskell record to it's vinyl -- representation. class GenericVinyl a names rs | a -> names rs where type FieldNames a :: [Symbol]- createRecId :: a -> Rec VF.Identity (ZipTypes names rs)+ createRecId :: a -> Rec VF.ElField (ZipTypes names rs) -- | Helps generate an instance for @GenericVinyl@, given a plain -- Haskell record declaration name. Uses Template Haskell, so@@ -51,9 +51,9 @@ (ns3 ~ FieldNames ($(n) B.Identity)) ) => GenericVinyl ($(n) B.Identity) ns3 rs where type FieldNames ($(n) B.Identity) = $(typeList1)- createRecId r = (go tranformedNP)+ createRecId r = withNames $ go transformedNP where SOP (Z prod) = from r- tranformedNP = (((GSN.trans_NP (Proxy :: Proxy (LiftedCoercible I VF.Identity)) (\(I x) -> VF.Identity $ coerce x) prod)) )- go = GSN.cata_NP RNil (:&)+ transformedNP = GSN.fromI_NP prod+ go = GSN.cata_NP RNil (:&) |]