diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-08-26 21:06:33 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-08-26 21:06:33 +0400 |
commit | 1c7601a6cca488202abb24578ac9163029f381ab (patch) | |
tree | f9c43237e33179c899c8f70174e56f67ec1e33a2 /bench | |
parent | 7c5980dae2000c45683b8af6ef91eb0a19b1e8ef (diff) |
~ Move instance for NFData to library.
Diffstat (limited to 'bench')
-rw-r--r-- | bench/Main.hs | 10 |
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 | |||
15 | import Data.AttoBencode.Parser as B | 15 | import Data.AttoBencode.Parser as B |
16 | import "bencoding" Data.BEncode as C | 16 | import "bencoding" Data.BEncode as C |
17 | 17 | ||
18 | |||
19 | instance NFData A.BEncode where | 18 | instance 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 | ||
31 | instance 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 | |||
37 | getRight :: Either String a -> a | 30 | getRight :: Either String a -> a |
38 | getRight (Left e) = error e | 31 | getRight = either error id |
39 | getRight (Right x) = x | ||
40 | 32 | ||
41 | main :: IO () | 33 | main :: IO () |
42 | main = do | 34 | main = do |