citeproc-hs-0.3.9: A Citation Style Language implementation in Haskell

Copyright | (c) Andrea Rossato
License | BSD-style (see LICENSE)
Maintainer | Andrea Rossato <andrea.rossato@unitn.it>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

Text.CSL.Reference

Description

The Reference type

Synopsis

- data Value = forall a . Data a => Value a
- type ReferenceMap = [(String, Value)]
- mkRefMap :: Data a => a -> ReferenceMap
- formatField :: String -> String
- fromValue :: Data a => Value -> Maybe a
- isValueSet :: Value -> Bool
- data Empty = Empty
- data Agent = Agent {
  - givenName :: [String]
  - droppingPart :: String
  - nonDroppingPart :: String
  - familyName :: String
  - nameSuffix :: String
  - literal :: String
  - commaSuffix :: Bool
  }
- data RefDate = RefDate {
  - year :: String
  - month :: String
  - season :: String
  - day :: String
  - other :: String
  - circa :: String
  }
- data RefType
  - = NoType
  - | Article
  - | ArticleMagazine
  - | ArticleNewspaper
  - | ArticleJournal
  - | Bill
  - | Book
  - | Broadcast
  - | Chapter
  - | Dataset
  - | Entry
  - | EntryDictionary
  - | EntryEncyclopedia
  - | Figure
  - | Graphic
  - | Interview
  - | Legislation
  - | LegalCase
  - | Manuscript
  - | Map
  - | MotionPicture
  - | MusicalScore
  - | Pamphlet
  - | PaperConference
  - | Patent
  - | Post
  - | PostWeblog
  - | PersonalCommunication
  - | Report
  - | Review
  - | ReviewBook
  - | Song
  - | Speech
  - | Thesis
  - | Treaty
  - | Webpage
- newtype CNum = CNum {
  - unCNum :: Int
  }
- data Reference = Reference {
  - refId :: String
  - refType :: RefType
  - author :: [Agent]
  - editor :: [Agent]
  - translator :: [Agent]
  - recipient :: [Agent]
  - interviewer :: [Agent]
  - composer :: [Agent]
  - director :: [Agent]
  - illustrator :: [Agent]
  - originalAuthor :: [Agent]
  - containerAuthor :: [Agent]
  - collectionEditor :: [Agent]
  - editorialDirector :: [Agent]
  - reviewedAuthor :: [Agent]
  - issued :: [RefDate]
  - eventDate :: [RefDate]
  - accessed :: [RefDate]
  - container :: [RefDate]
  - originalDate :: [RefDate]
  - submitted :: [RefDate]
  - title :: String
  - titleShort :: String
  - reviewedTitle :: String
  - containerTitle :: String
  - volumeTitle :: String
  - collectionTitle :: String
  - containerTitleShort :: String
  - collectionNumber :: String
  - originalTitle :: String
  - publisher :: String
  - originalPublisher :: String
  - publisherPlace :: String
  - originalPublisherPlace :: String
  - authority :: String
  - jurisdiction :: String
  - archive :: String
  - archivePlace :: String
  - archiveLocation :: String
  - event :: String
  - eventPlace :: String
  - page :: String
  - pageFirst :: String
  - numberOfPages :: String
  - version :: String
  - volume :: String
  - numberOfVolumes :: String
  - issue :: String
  - chapterNumber :: String
  - medium :: String
  - status :: String
  - edition :: String
  - section :: String
  - source :: String
  - genre :: String
  - note :: String
  - annote :: String
  - abstract :: String
  - keyword :: String
  - number :: String
  - references :: String
  - url :: String
  - doi :: String
  - isbn :: String
  - issn :: String
  - pmcid :: String
  - pmid :: String
  - callNumber :: String
  - dimensions :: String
  - scale :: String
  - categories :: [String]
  - language :: String
  - citationNumber :: CNum
  - firstReferenceNoteNumber :: Int
  - citationLabel :: String
  }
- emptyReference :: Reference
- numericVars :: [String]
- parseLocator :: String -> (String, String)
- getReference :: [Reference] -> Cite -> Reference
- processCites :: [Reference] -> [[Cite]] -> [[(Cite, Reference)]]
- setPageFirst :: Reference -> Reference
- setNearNote :: Style -> [[Cite]] -> [[Cite]]
- readNum :: String -> Int

# Documentation

data Value

An existential type to wrap the different types a `Reference` is made of. This way we can create a map to make queries easier.

Constructors

forall a . Data a => Value a |

Instances

Show Value |

type ReferenceMap = [(String, Value)]

mkRefMap :: Data a => a -> ReferenceMap

formatField :: String -> String

fromValue :: Data a => Value -> Maybe a

isValueSet :: Value -> Bool

data Empty

Constructors

Empty |

Instances

Data Empty |
Typeable * Empty |

data Agent

Constructors

Agent |
Fields givenName :: [String] droppingPart :: String nonDroppingPart :: String familyName :: String nameSuffix :: String literal :: String commaSuffix :: Bool

Instances

Eq Agent |
Data Agent |
Read Agent |
Show Agent |
XmlPickler Agent |
Typeable * Agent |

data RefDate

Constructors

RefDate |
Fields year :: String month :: String season :: String day :: String other :: String circa :: String

Instances

Eq RefDate |
Data RefDate |
Read RefDate |
Show RefDate |
Typeable * RefDate |

data RefType

Constructors

NoType |
Article |
ArticleMagazine |
ArticleNewspaper |
ArticleJournal |
Bill |
Book |
Broadcast |
Chapter |
Dataset |
Entry |
EntryDictionary |
EntryEncyclopedia |
Figure |
Graphic |
Interview |
Legislation |
LegalCase |
Manuscript |
Map |
MotionPicture |
MusicalScore |
Pamphlet |
PaperConference |
Patent |
Post |
PostWeblog |
PersonalCommunication |
Report |
Review |
ReviewBook |
Song |
Speech |
Thesis |
Treaty |
Webpage |

Instances

Eq RefType |
Data RefType |
Read RefType |
Show RefType |
Typeable * RefType |

newtype CNum

Constructors

CNum |
Fields unCNum :: Int

Instances

Eq CNum |
Data CNum |
Num CNum |
Read CNum |
Show CNum |
Typeable * CNum |

data Reference

The `Reference` record.

Constructors

Reference |
Fields refId :: String refType :: RefType author :: [Agent] editor :: [Agent] translator :: [Agent] recipient :: [Agent] interviewer :: [Agent] composer :: [Agent] director :: [Agent] illustrator :: [Agent] originalAuthor :: [Agent] containerAuthor :: [Agent] collectionEditor :: [Agent] editorialDirector :: [Agent] reviewedAuthor :: [Agent] issued :: [RefDate] eventDate :: [RefDate] accessed :: [RefDate] container :: [RefDate] originalDate :: [RefDate] submitted :: [RefDate] title :: String titleShort :: String reviewedTitle :: String containerTitle :: String volumeTitle :: String collectionTitle :: String containerTitleShort :: String collectionNumber :: String originalTitle :: String publisher :: String originalPublisher :: String publisherPlace :: String originalPublisherPlace :: String authority :: String jurisdiction :: String archive :: String archivePlace :: String archiveLocation :: String event :: String eventPlace :: String page :: String pageFirst :: String numberOfPages :: String version :: String volume :: String numberOfVolumes :: String issue :: String chapterNumber :: String medium :: String status :: String edition :: String section :: String source :: String genre :: String note :: String annote :: String abstract :: String keyword :: String number :: String references :: String url :: String doi :: String isbn :: String issn :: String pmcid :: String pmid :: String callNumber :: String dimensions :: String scale :: String categories :: [String] language :: String citationNumber :: CNum firstReferenceNoteNumber :: Int citationLabel :: String

Instances

Eq Reference |
Data Reference |
Read Reference |
Show Reference |
Typeable * Reference |

emptyReference :: Reference

numericVars :: [String]

parseLocator :: String -> (String, String)

getReference :: [Reference] -> Cite -> Reference

processCites :: [Reference] -> [[Cite]] -> [[(Cite, Reference)]]

setPageFirst :: Reference -> Reference

setNearNote :: Style -> [[Cite]] -> [[Cite]]

readNum :: String -> Int