summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Data/Name.hs13
-rw-r--r--src/Data/Paper.hs48
-rw-r--r--src/Data/Presentation.hs29
3 files changed, 90 insertions, 0 deletions
diff --git a/src/Data/Name.hs b/src/Data/Name.hs
new file mode 100644
index 0000000..4553cdc
--- /dev/null
+++ b/src/Data/Name.hs
@@ -0,0 +1,13 @@
+module Text.Name
+ ( Name (..)
+ ) where
+
+data Name a = Name
+ { lastName :: !a
+ , firstName :: !a
+ , middleName :: !(Maybe a)
+ } deriving (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
+
+instance Applicative Name where
+ pure x = Name x x (pure x)
+ Name l f m <*> Name x y z = Name (l x) (f y) (m <*> z)
diff --git a/src/Data/Paper.hs b/src/Data/Paper.hs
new file mode 100644
index 0000000..40ac91a
--- /dev/null
+++ b/src/Data/Paper.hs
@@ -0,0 +1,48 @@
+module Data.Paper
+ ( Paper (..)
+ , ArXiv (..)
+ , DOI (..)
+ ) where
+
+import Data.Name
+
+data Paper a = Paper
+ { date :: !Day
+ , authors :: ![Name a]
+ , title :: !a
+ , doi :: !(Maybe (DOI a))
+ , arXiv :: !(Maybe (ArXiv a))
+ , pubStatus :: !(PubStatus a)
+ , abstract :: !a
+ }
+
+data ArXiv a = ArXiv
+ { arxivDate :: !Day
+ , arxivID :: !a
+ , arxivClasses :: !(NonEmpty (ArXivClass a))
+ } deriving (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
+
+data ArXivClass a = ArXiv
+ { archive :: !a
+ , subjectClass :: !a
+ } deriving (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
+
+newtype DOI a = DOI a
+ deriving stock (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
+
+
+data PubStatus a
+ = Submitted
+ { journal :: !a
+ }
+ | Accepted
+ { journal :: !a
+ }
+ | Published
+ { journal :: !a
+ , volume :: !(Maybe a)
+ , number :: !(Maybe a)
+ , pages :: !(Maybe a)
+ }
+ | UnPublished
+ deriving (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
diff --git a/src/Data/Presentation.hs b/src/Data/Presentation.hs
new file mode 100644
index 0000000..fd6ee7a
--- /dev/null
+++ b/src/Data/Presentation.hs
@@ -0,0 +1,29 @@
+module Data.Presentation
+ ( Presentation (..)
+ , EventType (..)
+ ) where
+
+
+data Presentation a = Presentation
+ { date :: !Day
+ , title :: !a
+ , event :: !a
+ , location :: !a
+ , eventType :: !EventType
+ , attendenceType :: !AttendenceType
+ } deriving (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
+
+
+data AttendenceType
+ = Invited
+ | Contributed
+ deriving (Eq, Generic, Ord, Show)
+
+
+data EventType
+ = Conference
+ | Colloquium
+ | Seminar
+ | Workshop
+ | AtHome
+ deriving (Eq, Generic, Ord, Show)