blob: f4e9cd5cbad37e4f45b39750700ab12de1050f42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module Model.Resume
( Resume(..)
, getNewResumes
, getURLs
) where
import Data.List ((\\))
import Model.URL
data Resume = Resume
{ name :: String
, price :: Maybe String
, url :: URL
} deriving (Eq, Read, Show)
getNewResumes :: [URL] -> [Resume] -> ([URL], [Resume])
getNewResumes viewdURLs resumes =
let newURLs = (getURLs resumes) \\ viewdURLs
newResumes = filter (\resume -> elem (url resume) newURLs) resumes
in (viewdURLs ++ newURLs, newResumes)
getURLs :: [Resume] -> [URL]
getURLs = map url
|