blob: 59f669899dae8d1a64f71668db481638136e6e8d (
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 Model.URL (URL)
data Resume = Resume
{ name :: Text
, price :: Maybe Text
, url :: URL
, isPro :: Bool
} 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
|