diff options
Diffstat (limited to 'src/Ad.hs')
-rw-r--r-- | src/Ad.hs | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,6 +1,6 @@ module Ad - ( getResumes - , getAds + ( fetchResumes + , fetchAds ) where import Data.Text (Text) @@ -16,15 +16,15 @@ import Model.URL import Parser.Resume import Parser.Detail -getResumes :: URL -> IO (Either Text [Resume]) -getResumes url = fmap parseResumes <$> getPage url +fetchResumes :: URL -> IO (Either Text [Resume]) +fetchResumes url = fmap parseResumes <$> getPage url -getAds :: [Resume] -> IO (Either Text [Ad]) -getAds resumes = do - xs <- sequence $ map getAd resumes +fetchAds :: [Resume] -> IO (Either Text [Ad]) +fetchAds resumes = do + xs <- sequence $ map fetchAd resumes return $ sequence xs -getAd :: Resume -> IO (Either Text Ad) -getAd resume = do +fetchAd :: Resume -> IO (Either Text Ad) +fetchAd resume = do page <- getPage (url resume) fmap (\page -> Ad { resume = resume, detail = parseDetail page}) <$> getPage (url resume) |