Safe Haskell | None |
---|
- data WebCacheGeneric backend = WebCache {}
- type WebCache = WebCacheGeneric SqlBackend
- type WebCacheId = KeyBackend SqlBackend WebCache
- migrateAll :: forall m. (MonadBaseControl IO m, MonadIO m) => Migration (SqlPersist m)
- type Resolver a = String -> IO (Either String a)
- cached :: Resolver ByteString -> Resolver ByteString
- resolveBibtex :: String -> Resolver Reference
- readID :: Resolver Reference
- readDOI :: Resolver Reference
- readArXiv :: Resolver Reference
- readBibcode :: Resolver Reference
- readISBN :: Resolver Reference
- getDataFileName :: String -> IO String
Documentation
>>>
import Control.Applicative((<$>), (<*>))
>>>
import Data.Either.Utils(forceEither)
>>>
import Text.CSL
data WebCacheGeneric backend Source
data structure for accessing the reference cache database.
Show (WebCacheGeneric backend) | |
PersistField (WebCacheGeneric backend) | |
PersistEntity (WebCacheGeneric backend) |
migrateAll :: forall m. (MonadBaseControl IO m, MonadIO m) => Migration (SqlPersist m)Source
cached :: Resolver ByteString -> Resolver ByteStringSource
Take a resolver, and make it cached.
resolveBibtex :: String -> Resolver ReferenceSource
parse a Bibtex entry obtained in various ways.
readID :: Resolver ReferenceSource
Multi-purpose reference ID resolver. Resolve String
starting
with arXiv:, isbn:, doi: to Reference
.
>>>
(==) <$> readArXiv "1204.4779" <*> readID "arXiv:1204.4779"
True>>>
(==) <$> readDOI "10.1088/1749-4699/5/1/015003" <*> readID "doi:10.1088/1749-4699/5/1/015003"
True>>>
(==) <$> readISBN "9780199233212" <*> readID "isbn:9780199233212"
True
readDOI :: Resolver ReferenceSource
resolve a DOI to a Reference
.
>>>
ref <- forceEither <$> readDOI "10.1088/1749-4699/5/1/015003"
>>>
title ref
"Paraiso: an automated tuning framework for explicit solvers of partial differential equations">>>
putStrLn $ url ref
http://dx.doi.org/10.1088/1749-4699/5/1/015003
readArXiv :: Resolver ReferenceSource
resolve an arXiv ID to a Reference
. If it's a referred journal paper, it can also resolve
the refereed version of the paper.
>>>
ref <- forceEither <$> readArXiv "1204.4779"
>>>
title ref
"Paraiso: an automated tuning framework for explicit solvers of partial differential equations">>>
containerTitle ref
"Computational Science and Discovery"
readBibcode :: Resolver ReferenceSource
resolve an Bibcode ID to a Reference
.
>>>
ref <- forceEither <$> readBibcode " 2012CS&D....5a5003M"
>>>
title ref
"Paraiso: an automated tuning framework for explicit solvers of partial differential equations">>>
containerTitle ref
"Computational Science and Discovery"
readISBN :: Resolver ReferenceSource
resolve an ISBN to a Reference
.
>>>
ref <- forceEither <$> readISBN "9780199233212"
>>>
title ref
"The nature of computation"
getDataFileName :: String -> IO StringSource
a safer way to get data file name.