Permalink
Browse files

Conditionally define an NFData instance for ByteString

Newer bytestring packages define this for us.
  • Loading branch information...
1 parent 3a12ab1 commit 3415057fd4751d2a35439be38867448c87b14403 @bos bos committed Oct 23, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 test/Httpd.hs
View
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
module Httpd
( Request, Response, Server
, mkResponse
@@ -73,8 +75,10 @@ shed port handler =
reqBody = Shed.reqBody request
}
+#if !MIN_VERSION_bytestring(0,10,0)
instance NFData B.ByteString where
- rnf = rnf . B.length
+ rnf = rnf . B.length
+#endif
warp :: Server
warp port handler =
@@ -103,4 +107,4 @@ warp port handler =
request,
reqHeaders = map headerFromWarp (Warp.requestHeaders request),
reqBody = BC.unpack (B.concat body)
- }
+ }

0 comments on commit 3415057

Please sign in to comment.