blob: 46d07a1d9aae7c90d0ea003962f26e3081fe1d36 (
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
25
26
|
module Model.Resume
( Resume(..)
, getNewResumes
, getURLs
) where
import Data.List ((\\))
import Data.Text (Text)
import qualified Data.Text as T
import Model.URL
data Resume = Resume
{ name :: Text
, price :: Maybe Text
, 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 (newURLs, newResumes)
getURLs :: [Resume] -> [URL]
getURLs = map url
|