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

View File

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

View File

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