From 2595e40bb28065f5a6d123a3a33e0cbdd817293f Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org> Date: Mon, 30 Mar 2015 15:37:42 +0530 Subject: [PATCH] use maybeToList from Data.Maybe --- src/FuncTorrent/Metainfo.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 _)) = [] -- 2.45.2