X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fharbl.git;a=blobdiff_plain;f=harbl-cli%2Fsrc%2FConfiguration.hs;h=a6798e97f08f38803edb0116a2f5080bffae5465;hp=64adc7e6a7bb330b396cf0603b3381f61e49edca;hb=b47aaa60a797aee4ecdcd5535ed40c1a7b15ddce;hpb=6eb7fe0f53b0d8690a821cce9257b8b1a17fdaad diff --git a/harbl-cli/src/Configuration.hs b/harbl-cli/src/Configuration.hs index 64adc7e..a6798e9 100644 --- a/harbl-cli/src/Configuration.hs +++ b/harbl-cli/src/Configuration.hs @@ -7,8 +7,12 @@ module Configuration ( merge_optional ) where +import Data.Monoid ( Monoid(..) ) import System.Console.CmdArgs.Default ( Default(..) ) +-- From the harbl library. +import Network.DNS.RBL.Weight ( Weight ) + import qualified OptionalConfiguration as OC ( OptionalConfiguration(..) ) import Hosts ( Hosts(..) ) @@ -22,6 +26,7 @@ data Configuration = Configuration { hosts :: Hosts, lists :: Lists } +-- threshold :: Weight } deriving (Show) @@ -29,7 +34,9 @@ data Configuration = -- values. -- instance Default Configuration where - def = Configuration { hosts = def, lists = def } + def = Configuration { hosts = def, + lists = def } +-- threshold = def } -- | Merge a 'Configuration' with an 'OptionalConfiguration'. This is @@ -42,7 +49,5 @@ merge_optional :: Configuration merge_optional cfg opt_cfg = Configuration all_hosts all_lists where - all_hosts = - Hosts $ (get_hosts $ hosts cfg) ++ (get_hosts $ OC.hosts opt_cfg) - all_lists = - Lists $ (get_lists $ lists cfg) ++ (get_lists $ OC.lists opt_cfg) + all_hosts = (hosts cfg) `mappend` (OC.hosts opt_cfg) + all_lists = (lists cfg) `mappend` (OC.lists opt_cfg)