summaryrefslogtreecommitdiff
path: root/src/Data/BEncode
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-09-29 08:37:41 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-09-29 08:37:41 +0400
commitaec496291de09c0387d51a3ee1fbdb5927b19c15 (patch)
tree85895e2182431b97cac41fe221798d93c63ffec9 /src/Data/BEncode
parentbb73c6aa23a05ad55432b869649c89e9eb656d6c (diff)
Rename decode and encode to mimic Binary package
This lead to more intuitive API.
Diffstat (limited to 'src/Data/BEncode')
-rw-r--r--src/Data/BEncode/Internal.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Data/BEncode/Internal.hs b/src/Data/BEncode/Internal.hs
index 30cfbe7..3552bc9 100644
--- a/src/Data/BEncode/Internal.hs
+++ b/src/Data/BEncode/Internal.hs
@@ -9,8 +9,8 @@
9-- don't need to import this module. 9-- don't need to import this module.
10-- 10--
11module Data.BEncode.Internal 11module Data.BEncode.Internal
12 ( decode 12 ( parse
13 , encode 13 , build
14 , ppBEncode 14 , ppBEncode
15 ) where 15 ) where
16 16
@@ -59,8 +59,8 @@ builder = go
59 59
60-- | Convert bencoded value to raw bytestring according to the 60-- | Convert bencoded value to raw bytestring according to the
61-- specification. 61-- specification.
62encode :: BValue -> Lazy.ByteString 62build :: BValue -> Lazy.ByteString
63encode = B.toLazyByteString . builder 63build = B.toLazyByteString . builder
64 64
65{-------------------------------------------------------------------- 65{--------------------------------------------------------------------
66-- Deserialization 66-- Deserialization
@@ -113,8 +113,8 @@ parser = valueP
113 113
114-- | Try to convert raw bytestring to bencoded value according to 114-- | Try to convert raw bytestring to bencoded value according to
115-- specification. 115-- specification.
116decode :: ByteString -> Either String BValue 116parse :: ByteString -> Either String BValue
117decode = P.parseOnly parser 117parse = P.parseOnly parser
118 118
119{-------------------------------------------------------------------- 119{--------------------------------------------------------------------
120 Pretty Printing 120 Pretty Printing