diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Data/BEncode.hs | 10 | ||||
-rw-r--r-- | src/Data/BEncode/Internal.hs | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/Data/BEncode.hs b/src/Data/BEncode.hs index 1969595..8dc7c89 100644 --- a/src/Data/BEncode.hs +++ b/src/Data/BEncode.hs | |||
@@ -73,8 +73,6 @@ module Data.BEncode | |||
73 | -- * Serialization | 73 | -- * Serialization |
74 | , encode | 74 | , encode |
75 | , decode | 75 | , decode |
76 | , encoded | ||
77 | , decoded | ||
78 | 76 | ||
79 | -- ** Dictionaries | 77 | -- ** Dictionaries |
80 | -- *** Building | 78 | -- *** Building |
@@ -700,9 +698,9 @@ isDict _ = False | |||
700 | --------------------------------------------------------------------} | 698 | --------------------------------------------------------------------} |
701 | 699 | ||
702 | -- | The same as 'decode' but returns any bencodable value. | 700 | -- | The same as 'decode' but returns any bencodable value. |
703 | decoded :: BEncode a => ByteString -> Result a | 701 | decode :: BEncode a => ByteString -> Result a |
704 | decoded = decode >=> fromBEncode | 702 | decode = parse >=> fromBEncode |
705 | 703 | ||
706 | -- | The same as 'encode' but takes any bencodable value. | 704 | -- | The same as 'encode' but takes any bencodable value. |
707 | encoded :: BEncode a => a -> Lazy.ByteString | 705 | encode :: BEncode a => a -> Lazy.ByteString |
708 | encoded = encode . toBEncode | 706 | encode = build . toBEncode |
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 | -- |
11 | module Data.BEncode.Internal | 11 | module 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. |
62 | encode :: BValue -> Lazy.ByteString | 62 | build :: BValue -> Lazy.ByteString |
63 | encode = B.toLazyByteString . builder | 63 | build = 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. |
116 | decode :: ByteString -> Either String BValue | 116 | parse :: ByteString -> Either String BValue |
117 | decode = P.parseOnly parser | 117 | parse = P.parseOnly parser |
118 | 118 | ||
119 | {-------------------------------------------------------------------- | 119 | {-------------------------------------------------------------------- |
120 | Pretty Printing | 120 | Pretty Printing |