parseConfigString :: String -> Config
parseConfigString str = Config verifiers commands
   where
      commands = map (\(key, val) -> Command key val) cmdPairs
      verifiers = map (\(key, val) -> Verifier key val) verifierPairs

      verifierPairs = extractFromConfig "verifier." configPairs
      cmdPairs = extractFromConfig "command." configPairs

      configPairs = foldl add [] $ filter ignorable (lines str)
      add xs l = (parse l):xs
      parse l = let (k, v') = span (/='=') l in (trim k, trim $ tail v')
      ignorable l = (l /= "") && ('#' /= head l)
      trim = f . f
         where f = reverse . dropWhile (==' ')
parseConfigString :: String -> Config
parseConfigString str = Config verifiers commands
   where
      commands = map (\(key, val) -> Command key val) cmdPairs
      verifiers = map (\(key, val) -> Verifier key val) verifierPairs

      verifierPairs = extractFromConfig "verifier." configPairs
      cmdPairs = extractFromConfig "command." configPairs

      configPairs = foldl add [] $ filter ignorable (lines str)
      add xs l = (parse l):xs
      parse l = let (k, v') = span (/='=') l in (trim k, trim $ tail v')
      ignorable l = (l /= "") && ('#' /= head l)
      trim = f . f
         where f = reverse . dropWhile (==' ')
parseConfigString str = Config verifiers commands
   where
      commands = map (\(key, val) -> Command key val) cmdPairs
      verifiers = map (\(key, val) -> Verifier key val) verifierPairs

      verifierPairs = extractFromConfig "verifier." configPairs
      cmdPairs = extractFromConfig "command." configPairs

      configPairs = foldl add [] $ filter ignorable (lines str)
      add xs l = (parse l):xs
      parse l = let (k, v') = span (/='=') l in (trim k, trim $ tail v')
      ignorable l = (l /= "") && ('#' /= head l)
      trim = f . f
         where f = reverse . dropWhile (==' ')