postgresql-simple-sop 0.1.0.7 → 0.2
raw patch · 2 files changed
+5/−5 lines, 2 filesdep ~generics-sop
Dependency ranges changed: generics-sop
Files
postgresql-simple-sop.cabal view
@@ -1,5 +1,5 @@ name: postgresql-simple-sop-version: 0.1.0.7+version: 0.2 synopsis: Generic functions for postgresql-simple homepage: https://github.com/openbrainsrc/postgresql-simple-sop license: MIT@@ -15,4 +15,4 @@ ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-orphans -fwarn-incomplete-patterns build-depends: base >= 4.6 && < 5 , postgresql-simple- , generics-sop+ , generics-sop >= 0.2 && < 0.3
src/Database/PostgreSQL/Simple/SOP.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DefaultSignatures, OverloadedStrings, ScopedTypeVariables, DeriveGeneric, FlexibleInstances, ConstraintKinds, DataKinds, GADTs, TypeOperators #-}+{-# LANGUAGE DefaultSignatures, OverloadedStrings, ScopedTypeVariables, DeriveGeneric, FlexibleInstances, ConstraintKinds, DataKinds, GADTs, TypeOperators, FlexibleContexts #-} {- | @@ -41,13 +41,13 @@ -- |Generic fromRow gfromRow- :: (All FromField xs, Code a ~ '[xs], SingI xs, Generic a)+ :: (All FromField xs, Code a ~ '[xs], Generic a) => RowParser a gfromRow = to . SOP . Z <$> hsequence (hcpure fromFieldp field) where fromFieldp = Proxy :: Proxy FromField -- |Generic toRow-gtoRow :: (Generic a, Code a ~ '[xs], All ToField xs, SingI xs) => a -> [Action]+gtoRow :: (Generic a, Code a ~ '[xs], All ToField xs) => a -> [Action] gtoRow a = case from a of SOP (Z xs) -> hcollapse (hcliftA toFieldP (K . toField . unI) xs)