Newtype rather than data for predicates

This commit is contained in:
Julian K. Arni 2016-10-03 16:32:27 +02:00
parent 8eb5c334c1
commit 0563caafae

View File

@ -321,7 +321,7 @@ unauthorizedContainsWWWAuthenticate
-- | A predicate that depends only on the response. -- | A predicate that depends only on the response.
-- --
-- /Since 0.0.0.0/ -- /Since 0.0.0.0/
data ResponsePredicate = ResponsePredicate newtype ResponsePredicate = ResponsePredicate
{ getResponsePredicate :: Response LBS.ByteString -> IO () { getResponsePredicate :: Response LBS.ByteString -> IO ()
} deriving (Generic) } deriving (Generic)
@ -332,7 +332,7 @@ instance Monoid ResponsePredicate where
-- | A predicate that depends on both the request and the response. -- | A predicate that depends on both the request and the response.
-- --
-- /Since 0.0.0.0/ -- /Since 0.0.0.0/
data RequestPredicate = RequestPredicate newtype RequestPredicate = RequestPredicate
{ getRequestPredicate :: Request -> Manager -> IO [Response LBS.ByteString] { getRequestPredicate :: Request -> Manager -> IO [Response LBS.ByteString]
} deriving (Generic) } deriving (Generic)