git.iko.soy/servant-quickcheck
on master help sign in
Newtype rather than data for predicates
commit0563caafaedbdf6af45aad99c2847b6c99025a23 authorJulian K. Arni <jkarni@gmail.com> dateMon 3 Oct 2016, 16:32 (10 years ago) parent8eb5c33
1 file changed+2−2
src/Servant/QuickCheck/Internal/Predicates.hs+2−2
src/Servant/QuickCheck/Internal/Predicates.hs+2−2
@@ -321,7 +321,7 @@ unauthorizedContainsWWWAuthenticate
321321-- | A predicate that depends only on the response.
322322--
323323-- /Since 0.0.0.0/
324−data ResponsePredicate = ResponsePredicate
324+newtype ResponsePredicate = ResponsePredicate
325325 { getResponsePredicate :: Response LBS.ByteString -> IO ()
326326 } deriving (Generic)
327327
@@ -332,7 +332,7 @@ instance Monoid ResponsePredicate where
332332-- | A predicate that depends on both the request and the response.
333333--
334334-- /Since 0.0.0.0/
335−data RequestPredicate = RequestPredicate
335+newtype RequestPredicate = RequestPredicate
336336 { getRequestPredicate :: Request -> Manager -> IO [Response LBS.ByteString]
337337 } deriving (Generic)
338338