| citeproc-hs-0.2: A Citation Style Language implementation in Haskell | Source code | Contents | Index

Text.CSL.Reference

Portability | unportable
Stability | unstable
Maintainer | Andrea Rossato <andrea.rossato@unitn.it>

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

= Entity String

| Person {

namePrefix :: String
givenName :: [String]
initials :: String
articular :: String
familyName :: String
nameSuffix :: String

}

data RefDate = RefDate {

year :: Int
month :: Int
day :: Int
other :: String

}

data RefType

= NoType
| Article
| ArticleMagazine
| ArticleNewspaper
| ArticleJournal
| Bill
| Book
| Broadcast
| Chapter
| 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 {

citeKey :: String
refType :: RefType
author :: [Agent]
editor :: [Agent]
translator :: [Agent]
recipient :: [Agent]
interviewer :: [Agent]
publisher :: [Agent]
composer :: [Agent]
originalPublisher :: [Agent]
originalAuthor :: [Agent]
containerAuthor :: [Agent]
collectionEditor :: [Agent]
issued :: [RefDate]
eventDate :: [RefDate]
accessed :: [RefDate]
container :: [RefDate]
originalDate :: [RefDate]
title :: String
containerTitle :: String
collectionTitle :: String
collectionNumber :: Int
originalTitle :: String
publisherPlace :: String
archive :: String
archivePlace :: String
archiveLocation :: String
event :: String
eventPlace :: String
page :: String
locator :: Locator
version :: String
volume :: String
numberOfVolumes :: Int
issue :: String
chapterNumber :: String
medium :: String
status :: String
edition :: String
section :: String
genre :: String
note :: String
annote :: String
abstract :: String
keyword :: String
number :: String
references :: String
url :: String
doi :: String
isbn :: String
citationNumber :: CNum
yearSuffix :: String
citationLabel :: String

}

emptyReference :: Reference
getReference :: [Reference] -> (String, String) -> Reference
getReference' :: [Reference] -> ((String, String), (String, Int)) -> (String, Reference)

data Locator

= NoneLoc
| BookLoc String
| ChapterLoc String
| ColumnLoc String
| FigureLoc String
| FolioLoc String
| IssueLoc String
| LineLoc String
| NoteLoc String
| OpusLoc String
| PageLoc String
| PageFstLoc String
| ParaLoc String
| PartLoc String
| SecLoc String
| SubVerbLoc String
| VolLoc String
| VerseLoc String

locString :: Locator -> String
parseLocator :: String -> Locator
generatePosition :: [[(String, String)]] -> [[((String, String), (String, Int))]]
getPos :: Eq a => ([a], [a]) -> [[(a, String)]] -> [[((a, String), (String, Int))]]

Documentation

data Value | Source

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)] | Source

mkRefMap :: Data a => a -> ReferenceMap | Source

formatField :: String -> String | Source

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

isValueSet :: Value -> Bool | Source

data Empty | Source

Constructors

Empty |

Instances

Data Empty
Typeable Empty

data Agent | Source

Constructors

Entity String |
Person |

namePrefix :: String |
givenName :: [String] |
initials :: String |
articular :: String |
familyName :: String |
nameSuffix :: String |

Instances

Eq Agent
Data Agent
Read Agent
Show Agent
Typeable Agent
XmlPickler Agent

data RefDate | Source

Constructors

RefDate |

year :: Int |
month :: Int |
day :: Int |
other :: String |

Instances

Eq RefDate
Data RefDate
Read RefDate
Show RefDate
Typeable RefDate

data RefType | Source

Constructors

NoType |
Article |
ArticleMagazine |
ArticleNewspaper |
ArticleJournal |
Bill |
Book |
Broadcast |
Chapter |
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 | Source

Constructors

CNum |

unCNum :: Int |

Instances

Eq CNum
Data CNum
Num CNum
Read CNum
Show CNum
Typeable CNum

data Reference | Source

The `Reference` record.
Constructors

Reference |

citeKey :: String |
refType :: RefType |
author :: [Agent] |
editor :: [Agent] |
translator :: [Agent] |
recipient :: [Agent] |
interviewer :: [Agent] |
publisher :: [Agent] |
composer :: [Agent] |
originalPublisher :: [Agent] |
originalAuthor :: [Agent] |
containerAuthor :: [Agent] |
collectionEditor :: [Agent] |
issued :: [RefDate] |
eventDate :: [RefDate] |
accessed :: [RefDate] |
container :: [RefDate] |
originalDate :: [RefDate] |
title :: String |
containerTitle :: String |
collectionTitle :: String |
collectionNumber :: Int |
originalTitle :: String |
publisherPlace :: String |
archive :: String |
archivePlace :: String |
archiveLocation :: String |
event :: String |
eventPlace :: String |
page :: String |
locator :: Locator |
version :: String |
volume :: String |
numberOfVolumes :: Int |
issue :: String |
chapterNumber :: String |
medium :: String |
status :: String |
edition :: String |
section :: String |
genre :: String |
note :: String |
annote :: String |
abstract :: String |
keyword :: String |
number :: String |
references :: String |
url :: String |
doi :: String |
isbn :: String |
citationNumber :: CNum |
yearSuffix :: String |
citationLabel :: String |

Instances

Eq Reference
Data Reference
Read Reference
Show Reference
Typeable Reference

emptyReference :: Reference | Source

getReference :: [Reference] -> (String, String) -> Reference | Source

With the list of `Reference`s and the tuple (citation key, locator), return the needed reference with the correct locator set.

getReference' :: [Reference] -> ((String, String), (String, Int)) -> (String, Reference) | Source

With the `Reference` list and the generated position for each tuple of citation key and locator, produce a list of `Reference`s with their positions (which come first.

data Locator | Source

Constructors

NoneLoc |
BookLoc String |
ChapterLoc String |
ColumnLoc String |
FigureLoc String |
FolioLoc String |
IssueLoc String |
LineLoc String |
NoteLoc String |
OpusLoc String |
PageLoc String |
PageFstLoc String |
ParaLoc String |
PartLoc String |
SecLoc String |
SubVerbLoc String |
VolLoc String |
VerseLoc String |

Instances

Eq Locator
Data Locator
Read Locator
Show Locator
Typeable Locator

locString :: Locator -> String | Source

parseLocator :: String -> Locator | Source

generatePosition :: [[(String, String)]] -> [[((String, String), (String, Int))]] | Source

For each citation group generate the position and the citation number of each citation.

getPos :: Eq a => ([a], [a]) -> [[(a, String)]] -> [[((a, String), (String, Int))]] | Source

Produced by Haddock version 2.4.2