diff options
Diffstat (limited to 'src/Data/Torrent')
-rw-r--r-- | src/Data/Torrent/InfoHash.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Data/Torrent/InfoHash.hs b/src/Data/Torrent/InfoHash.hs index 7442c61c..08cee3c9 100644 --- a/src/Data/Torrent/InfoHash.hs +++ b/src/Data/Torrent/InfoHash.hs | |||
@@ -15,7 +15,6 @@ module Data.Torrent.InfoHash | |||
15 | ( InfoHash | 15 | ( InfoHash |
16 | 16 | ||
17 | -- * Parsing | 17 | -- * Parsing |
18 | , byteStringToInfoHash | ||
19 | , textToInfoHash | 18 | , textToInfoHash |
20 | 19 | ||
21 | -- * Rendering | 20 | -- * Rendering |
@@ -163,12 +162,9 @@ instance FromJSON InfoHash where | |||
163 | ignoreErrorMsg :: Either a b -> Maybe b | 162 | ignoreErrorMsg :: Either a b -> Maybe b |
164 | ignoreErrorMsg = either (const Nothing) Just | 163 | ignoreErrorMsg = either (const Nothing) Just |
165 | 164 | ||
166 | -- | TODO remove from API | 165 | -- | Tries both base16 and base32 while decoding info hash. |
167 | byteStringToInfoHash :: BS.ByteString -> Maybe InfoHash | 166 | -- |
168 | byteStringToInfoHash = ignoreErrorMsg . safeConvert | 167 | -- Use 'safeConvert' for detailed error messages. |
169 | |||
170 | -- | Tries both base16 and base32 while decoding info hash. To Use | ||
171 | -- 'safeConvert' to find out | ||
172 | -- | 168 | -- |
173 | textToInfoHash :: Text -> Maybe InfoHash | 169 | textToInfoHash :: Text -> Maybe InfoHash |
174 | textToInfoHash = ignoreErrorMsg . safeConvert | 170 | textToInfoHash = ignoreErrorMsg . safeConvert |