git.iko.soy/servant-quickcheck
on master help sign in
Newtype rather than data for predicates
0563caaJulian K. Arni
src/Servant/QuickCheck/Internal/Predicates.hs+2−2
@@ -321,7 +321,7 @@ unauthorizedContainsWWWAuthenticate
321-- | A predicate that depends only on the response.
321-- | A predicate that depends only on the response.
322--
322--
323-- /Since 0.0.0.0/
323-- /Since 0.0.0.0/
324−data ResponsePredicate = ResponsePredicate
324+newtype ResponsePredicate = ResponsePredicate
325 { getResponsePredicate :: Response LBS.ByteString -> IO ()
325 { getResponsePredicate :: Response LBS.ByteString -> IO ()
326 } deriving (Generic)
326 } deriving (Generic)
327
327
@@ -332,7 +332,7 @@ instance Monoid ResponsePredicate where
332-- | A predicate that depends on both the request and the response.
332-- | A predicate that depends on both the request and the response.
333--
333--
334-- /Since 0.0.0.0/
334-- /Since 0.0.0.0/
335−data RequestPredicate = RequestPredicate
335+newtype RequestPredicate = RequestPredicate
336 { getRequestPredicate :: Request -> Manager -> IO [Response LBS.ByteString]
336 { getRequestPredicate :: Request -> Manager -> IO [Response LBS.ByteString]
337 } deriving (Generic)
337 } deriving (Generic)
338
338