projects
/
functorrent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75cf17f
)
cute hlint suggestion for transformng a function
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Tue, 17 Feb 2015 09:37:56 +0000
(15:07 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Tue, 17 Feb 2015 09:37:56 +0000
(15:07 +0530)
src/Bencode.hs
patch
|
blob
|
history
diff --git
a/src/Bencode.hs
b/src/Bencode.hs
index 6b46a929dabb5614d2d02e79d1248b9add785549..1fe6aeadd28f945f9064721e2770574ea93817b8 100644
(file)
--- a/
src/Bencode.hs
+++ b/
src/Bencode.hs
@@
-132,6
+132,6
@@
encode (Bstr bs) = let s = BC.unpack bs
in show (length s) ++ ":" ++ s
encode (Bint i) = "i" ++ show i ++ "e"
encode (Blist xs) = "l" ++ encodeList xs ++ "e"
- where encodeList = foldr (
\x -> (++ encode x)
) ""
+ where encodeList = foldr (
(++) . encode
) ""
encode (Bdict d) = "d" ++ encodeDict d ++ "e"
where encodeDict m = concat [encode k ++ encode (m M.! k) | k <- M.keys m]