From: Ramakrishnan Muthukrishnan Date: Mon, 30 Mar 2015 10:07:42 +0000 (+0530) Subject: use maybeToList from Data.Maybe X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/something?a=commitdiff_plain;h=2595e40bb28065f5a6d123a3a33e0cbdd817293f;p=functorrent.git use maybeToList from Data.Maybe --- diff --git a/src/FuncTorrent/Metainfo.hs b/src/FuncTorrent/Metainfo.hs index 9ff3ce3..216fd24 100644 --- a/src/FuncTorrent/Metainfo.hs +++ b/src/FuncTorrent/Metainfo.hs @@ -12,6 +12,7 @@ module FuncTorrent.Metainfo import Prelude hiding (lookup) import Data.ByteString.Char8 (ByteString, unpack) import Data.Map as M ((!), lookup) +import Data.Maybe (maybeToList) import FuncTorrent.Bencode (BVal(..), bstrToString) @@ -71,10 +72,6 @@ mkMetaInfo (Bdict m) = let (Just info') = mkInfo $ m ! "info" } mkMetaInfo _ = Nothing -maybeToList :: Maybe a -> [a] -maybeToList Nothing = [] -maybeToList (Just x) = [x] - getAnnounceList :: Maybe BVal -> [String] getAnnounceList Nothing = [] getAnnounceList (Just (Bint _)) = []