summaryrefslogtreecommitdiff
path: root/src/Data/Torrent/InfoHash.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-11-28 15:24:48 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-11-28 15:24:48 +0400
commite2edd7436a287160d993815e2dc1ad9792435b9c (patch)
tree9295e22134bdca5f4fdb12c67a2b986a667f26b8 /src/Data/Torrent/InfoHash.hs
parent2d1b6b54825fd3f072bd81ac94106edd04cf52bb (diff)
Remove byteStringToInfoHash function
Diffstat (limited to 'src/Data/Torrent/InfoHash.hs')
-rw-r--r--src/Data/Torrent/InfoHash.hs10
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
163ignoreErrorMsg :: Either a b -> Maybe b 162ignoreErrorMsg :: Either a b -> Maybe b
164ignoreErrorMsg = either (const Nothing) Just 163ignoreErrorMsg = either (const Nothing) Just
165 164
166-- | TODO remove from API 165-- | Tries both base16 and base32 while decoding info hash.
167byteStringToInfoHash :: BS.ByteString -> Maybe InfoHash 166--
168byteStringToInfoHash = 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--
173textToInfoHash :: Text -> Maybe InfoHash 169textToInfoHash :: Text -> Maybe InfoHash
174textToInfoHash = ignoreErrorMsg . safeConvert 170textToInfoHash = ignoreErrorMsg . safeConvert