X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FFeedHosts.hs;fp=src%2FFeedHosts.hs;h=0000000000000000000000000000000000000000;hb=95e23e65db31cf51c9f207a6b447da19920ee1a1;hp=43bab176aa67efeaba8e6a045aa1ae9d8057481d;hpb=3fbc7d861d1f95513151010cd0f2d620befc2870;p=dead%2Fhtsn.git diff --git a/src/FeedHosts.hs b/src/FeedHosts.hs deleted file mode 100644 index 43bab17..0000000 --- a/src/FeedHosts.hs +++ /dev/null @@ -1,37 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} - --- | A newtype around a list of Strings which represent the feed --- hosts. This is all to avoid an orphan instance of Configured for --- [String] if we had defined one in e.g. OptionalConfiguration. --- -module FeedHosts -where - --- DC is needed only for the DCT.Configured instance of String. -import qualified Data.Configurator as DC() -import qualified Data.Configurator.Types as DCT -import Data.Data (Data) -import System.Console.CmdArgs.Default (Default(..)) -import Data.Typeable (Typeable) - - -newtype FeedHosts = - FeedHosts { get_feed_hosts :: [String] } - deriving (Data, Show, Typeable) - - -instance Default FeedHosts where - def = FeedHosts ["feed1.sportsnetwork.com", - "feed2.sportsnetwork.com", - "feed3.sportsnetwork.com"] - - -instance DCT.Configured FeedHosts where - convert (DCT.List xs) = - fmap FeedHosts (mapM convert_string xs) - where - convert_string :: DCT.Value -> Maybe String - convert_string = DCT.convert - - convert _ = Nothing -