"noResult" -> "unit"

This commit is contained in:
Nikita Volkov 2015-11-22 08:34:27 +03:00
parent ccc13a9a9b
commit 66eee199cb
3 changed files with 9 additions and 9 deletions

View File

@ -4,7 +4,7 @@ module Hasql.Decoding
( (
-- * Result -- * Result
Result, Result,
noResult, unit,
rowsAffected, rowsAffected,
singleRow, singleRow,
-- ** Specialized multi-row results -- ** Specialized multi-row results
@ -82,9 +82,9 @@ newtype Result a =
-- --
-- Useful for statements like @INSERT@ or @CREATE@. -- Useful for statements like @INSERT@ or @CREATE@.
-- --
{-# INLINABLE noResult #-} {-# INLINABLE unit #-}
noResult :: Result () unit :: Result ()
noResult = unit =
Result (Results.single Result.unit) Result (Results.single Result.unit)
-- | -- |
@ -158,11 +158,11 @@ rowsList =
-- ** Instances -- ** Instances
------------------------- -------------------------
-- | Maps to 'noResult'. -- | Maps to 'unit'.
instance Default (Result ()) where instance Default (Result ()) where
{-# INLINE def #-} {-# INLINE def #-}
def = def =
noResult unit
-- | Maps to 'rowsAffected'. -- | Maps to 'rowsAffected'.
instance Default (Result Int64) where instance Default (Result Int64) where

View File

@ -27,14 +27,14 @@ tree =
DSL.session $ do DSL.session $ do
let let
query = query =
H.Query sql mempty HD.noResult True H.Query sql mempty HD.unit True
where where
sql = sql =
"drop type if exists mood" "drop type if exists mood"
in DSL.query () query in DSL.query () query
let let
query = query =
H.Query sql mempty HD.noResult True H.Query sql mempty HD.unit True
where where
sql = sql =
"create type mood as enum ('sad', 'ok', 'happy')" "create type mood as enum ('sad', 'ok', 'happy')"

View File

@ -13,7 +13,7 @@ def sql =
plain :: ByteString -> H.Query () () plain :: ByteString -> H.Query () ()
plain sql = plain sql =
H.Query sql mempty HD.noResult False H.Query sql mempty HD.unit False
dropType :: ByteString -> H.Query () () dropType :: ByteString -> H.Query () ()
dropType name = dropType name =