loadFeedsFromFile path = do file <- readFile path
                            return $ rmNothing $ map parseLine $ lines file
    where rmNothing :: [Maybe RSSFeed] -> [RSSFeed]
          rmNothing  []           = []
          rmNothing (Nothing:rs)  = rmNothing rs
          rmNothing ((Just r):rs) = r:rmNothing rs
          parseLine :: String -> Maybe RSSFeed
          parseLine str
               | parts == [] = Nothing
               | otherwise   = Just $ RSSFeed (Just $ head parts) Nothing Nothing Nothing (Just $ tail parts)
              where parts = cutLine str "" False

-- Initialisation of data --------------------------------------------
loadFeedsFromFile path = do file <- readFile path
                            return $ rmNothing $ map parseLine $ lines file
    where rmNothing :: [Maybe RSSFeed] -> [RSSFeed]
          rmNothing  []           = []
          rmNothing (Nothing:rs)  = rmNothing rs
          rmNothing ((Just r):rs) = r:rmNothing rs
          parseLine :: String -> Maybe RSSFeed
          parseLine str
               | parts == [] = Nothing
               | otherwise   = Just $ RSSFeed (Just $ head parts) Nothing Nothing Nothing (Just $ tail parts)
              where parts = cutLine str "" False

-- Initialisation of data --------------------------------------------
loadFeedsFromFile path = do file <- readFile path
                            return $ rmNothing $ map parseLine $ lines file
    where rmNothing :: [Maybe RSSFeed] -> [RSSFeed]
          rmNothing  []           = []
          rmNothing (Nothing:rs)  = rmNothing rs
          rmNothing ((Just r):rs) = r:rmNothing rs
          parseLine :: String -> Maybe RSSFeed
          parseLine str
               | parts == [] = Nothing
               | otherwise   = Just $ RSSFeed (Just $ head parts) Nothing Nothing Nothing (Just $ tail parts)
              where parts = cutLine str "" False

-- Initialisation of data --------------------------------------------