citation-resolve- convert document IDs such as DOI, ISBN, arXiv ID to bibliographic reference.

Safe HaskellNone




newtype DB Source

The data structure that carries the resolved references. Since the mapping Reference -> BibTeX is not the inverse of BibTeX -> Reference for the version citeproc-hs-0.3.8 and loses some information, we choose to store the original BibTeX string in the DB, rather than Reference.




unDB :: Map String String


db :: Simple Iso DB (Map String String)Source

The lens for accessing the map within the DB.

withDBFile :: (MonadIO m, MonadState DB m) => FilePath -> m a -> m aSource

type RM m a b = a -> EitherT String m bSource

Resolver Monad is a function that converts a key of type a to some other type b, which may fail with an error message.

liftIOE :: MonadIO m => IO (Either a b) -> EitherT a m bSource

Perform possibly failing IO within a monad

resolveBibtex :: MonadIO m => String -> RM m String ReferenceSource

parse a Bibtex entry that contains single reference.

resolveEither :: forall m. (MonadIO m, MonadState DB m) => String -> EitherT String m ReferenceSource

resolve a document url to a Reference, or emits a error message with reason why it fails.

getDataFileName :: String -> IO StringSource

a safer way to get data file name.