From 0563caafaedbdf6af45aad99c2847b6c99025a23 Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Mon, 3 Oct 2016 16:32:27 +0200 Subject: [PATCH] Newtype rather than data for predicates --- src/Servant/QuickCheck/Internal/Predicates.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Servant/QuickCheck/Internal/Predicates.hs b/src/Servant/QuickCheck/Internal/Predicates.hs index 2832364..523bfd0 100644 --- a/src/Servant/QuickCheck/Internal/Predicates.hs +++ b/src/Servant/QuickCheck/Internal/Predicates.hs @@ -321,7 +321,7 @@ unauthorizedContainsWWWAuthenticate -- | A predicate that depends only on the response. -- -- /Since 0.0.0.0/ -data ResponsePredicate = ResponsePredicate +newtype ResponsePredicate = ResponsePredicate { getResponsePredicate :: Response LBS.ByteString -> IO () } deriving (Generic) @@ -332,7 +332,7 @@ instance Monoid ResponsePredicate where -- | A predicate that depends on both the request and the response. -- -- /Since 0.0.0.0/ -data RequestPredicate = RequestPredicate +newtype RequestPredicate = RequestPredicate { getRequestPredicate :: Request -> Manager -> IO [Response LBS.ByteString] } deriving (Generic)