aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Resume.hs17
-rw-r--r--src/Model/URL.hs5
2 files changed, 21 insertions, 1 deletions
diff --git a/src/Model/Resume.hs b/src/Model/Resume.hs
index 1b73baf..f4e9cd5 100644
--- a/src/Model/Resume.hs
+++ b/src/Model/Resume.hs
@@ -1,9 +1,24 @@
module Model.Resume
( Resume(..)
+ , getNewResumes
+ , getURLs
) where
+import Data.List ((\\))
+
+import Model.URL
+
data Resume = Resume
{ name :: String
, price :: Maybe String
- , url :: 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
diff --git a/src/Model/URL.hs b/src/Model/URL.hs
new file mode 100644
index 0000000..91cf22a
--- /dev/null
+++ b/src/Model/URL.hs
@@ -0,0 +1,5 @@
+module Model.URL
+ ( URL
+ ) where
+
+type URL = String