summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-08-26 21:06:33 +0400
committerSam T <pxqr.sta@gmail.com>2013-08-26 21:06:33 +0400
commit1c7601a6cca488202abb24578ac9163029f381ab (patch)
treef9c43237e33179c899c8f70174e56f67ec1e33a2 /bench
parent7c5980dae2000c45683b8af6ef91eb0a19b1e8ef (diff)
~ Move instance for NFData to library.
Diffstat (limited to 'bench')
-rw-r--r--bench/Main.hs10
1 files changed, 1 insertions, 9 deletions
diff --git a/bench/Main.hs b/bench/Main.hs
index 2edf43a..20de179 100644
--- a/bench/Main.hs
+++ b/bench/Main.hs
@@ -15,7 +15,6 @@ import Data.AttoBencode as B
15import Data.AttoBencode.Parser as B 15import Data.AttoBencode.Parser as B
16import "bencoding" Data.BEncode as C 16import "bencoding" Data.BEncode as C
17 17
18
19instance NFData A.BEncode where 18instance NFData A.BEncode where
20 rnf (A.BInt i) = rnf i 19 rnf (A.BInt i) = rnf i
21 rnf (A.BString s) = rnf s 20 rnf (A.BString s) = rnf s
@@ -28,15 +27,8 @@ instance NFData B.BValue where
28 rnf (B.BList l) = rnf l 27 rnf (B.BList l) = rnf l
29 rnf (B.BDict d) = rnf d 28 rnf (B.BDict d) = rnf d
30 29
31instance NFData C.BEncode where
32 rnf (C.BInteger i) = rnf i
33 rnf (C.BString s) = rnf s
34 rnf (C.BList l) = rnf l
35 rnf (C.BDict d) = rnf d
36
37getRight :: Either String a -> a 30getRight :: Either String a -> a
38getRight (Left e) = error e 31getRight = either error id
39getRight (Right x) = x
40 32
41main :: IO () 33main :: IO ()
42main = do 34main = do