diff options
| author | Chris Wells <chris@mathematicaster.org> | 2024-12-19 11:46:31 -0600 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2024-12-19 11:46:31 -0600 |
| commit | cbdb612f85355930ea7a6fbc453edbdf76715f69 (patch) | |
| tree | c71441d654c6727a49719c51e8ce16c9e9f0bb54 /src/Data | |
| parent | 23c9c4e32d2f54aae627c1cff7bc7fc91e771e3d (diff) | |
| download | cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.tar cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.tar.gz cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.tar.bz2 cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.tar.lz cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.tar.xz cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.tar.zst cv-cbdb612f85355930ea7a6fbc453edbdf76715f69.zip | |
Thinking about doing this in haskell
Diffstat (limited to 'src/Data')
| -rw-r--r-- | src/Data/Name.hs | 13 | ||||
| -rw-r--r-- | src/Data/Paper.hs | 48 | ||||
| -rw-r--r-- | src/Data/Presentation.hs | 29 |
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) |
