git.iko.soy/typeable/postgresql-simple
on master help sign in
Add fromBinary, fromHStoreMap and fromHStoreList
commit78cb44b27016ab9101d0d2d4a99e05117e74a004 authorBas van Dijk <v.dijk.bas@gmail.com> dateMon 21 Oct 2013, 13:17 (13 years ago) parent6d6dd33
2 files changed+3−3
src/Database/PostgreSQL/Simple/HStore/Implementation.hs+2−2 src/Database/PostgreSQL/Simple/Types.hs+1−1
src/Database/PostgreSQL/Simple/HStore/Implementation.hs+2−2
@@ -112,7 +112,7 @@ instance ToField HStoreBuilder where
112112 toField Empty = toField (BS.empty)
113113 toField (Comma x) = toField (Blaze.toLazyByteString x)
114114
115−newtype HStoreList = HStoreList [(Text,Text)] deriving (Typeable, Show)
115+newtype HStoreList = HStoreList {fromHStoreList :: [(Text,Text)]} deriving (Typeable, Show)
116116
117117-- | hstore
118118instance ToHStore HStoreList where
@@ -139,7 +139,7 @@ instance FromField HStoreList where
139139 Right (Right val) ->
140140 return val
141141
142−newtype HStoreMap = HStoreMap (Map Text Text) deriving (Eq, Ord, Typeable, Show)
142+newtype HStoreMap = HStoreMap {fromHStoreMap :: Map Text Text} deriving (Eq, Ord, Typeable, Show)
143143
144144instance ToHStore HStoreMap where
145145 toHStore (HStoreMap xs) = Map.foldrWithKey f mempty xs
src/Database/PostgreSQL/Simple/Types.hs+1−1
@@ -109,7 +109,7 @@ newtype In a = In a
109109 deriving (Eq, Ord, Read, Show, Typeable, Functor)
110110
111111-- | Wrap binary data for use as a @bytea@ value.
112−newtype Binary a = Binary a
112+newtype Binary a = Binary {fromBinary :: a}
113113 deriving (Eq, Ord, Read, Show, Typeable, Functor)
114114
115115-- | A composite type to parse your custom data structures without