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