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

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

Text.CSL.Eval.Common

Description

The CSL implementation

Synopsis

- data EvalState = EvalState {
  - ref :: ReferenceMap
  - env :: Environment
  - debug :: [String]
  - mode :: EvalMode
  - disamb :: Bool
  - consume :: Bool
  - authSub :: [String]
  - consumed :: [String]
  - edtrans :: Bool
  - etal :: [[Output]]
  - contNum :: [Agent]
  - lastName :: [Output]
  }
- data Environment = Env {
  - cite :: Cite
  - terms :: [CslTerm]
  - macros :: [MacroMap]
  - dates :: [Element]
  - options :: [Option]
  - names :: [Element]
  - abbrevs :: [Abbrev]
  }
- data EvalMode
  - = EvalSorting Cite
  - | EvalCite Cite
  - | EvalBiblio Cite
- isSorting :: EvalMode -> Bool
- getAbbreviation :: [Abbrev] -> String -> String -> String
- getTerm :: Bool -> Form -> String -> State EvalState String
- getStringVar :: String -> State EvalState String
- getDateVar :: String -> State EvalState [RefDate]
- getLocVar :: State EvalState (String, String)
- getVar :: a -> (Value -> a) -> String -> State EvalState a
- getAgents :: String -> State EvalState [Agent]
- getAgents' :: String -> State EvalState [Agent]
- getStringValue :: Value -> String
- getOptionVal :: String -> [Option] -> String
- isOptionSet :: String -> [Option] -> Bool
- isTitleVar :: String -> Bool
- isTitleShortVar :: String -> Bool
- getTitleShort :: String -> State EvalState String
- isVarSet :: String -> State EvalState Bool
- withRefMap :: (ReferenceMap -> a) -> State EvalState a
- formatVariable :: String -> String
- consumeVariable :: String -> State EvalState ()
- consuming :: State EvalState a -> State EvalState a
- when' :: Monad m => m Bool -> m [a] -> m [a]
- whenElse :: Monad m => m Bool -> m a -> m a -> m a
- concatMapM :: (Monad m, Functor m, Eq b) => (a -> m [b]) -> [a] -> m [b]
- trace :: String -> State EvalState ()

# Documentation

data EvalState Source

Constructors

EvalState |

Fields

ref :: ReferenceMap
env :: Environment
debug :: [String]
mode :: EvalMode
disamb :: Bool
consume :: Bool
authSub :: [String]
consumed :: [String]
edtrans :: Bool
etal :: [[Output]]
contNum :: [Agent]
lastName :: [Output]

Instances

Show EvalState |

data Environment Source

Constructors

Env |

Fields

cite :: Cite
terms :: [CslTerm]
macros :: [MacroMap]
dates :: [Element]
options :: [Option]
names :: [Element]
abbrevs :: [Abbrev]

Instances

Show Environment |

data EvalMode Source

Constructors

EvalSorting Cite |
EvalCite Cite |
EvalBiblio Cite |

Instances

Eq EvalMode |
Show EvalMode |

isSorting :: EvalMode -> Bool Source

getAbbreviation :: [Abbrev] -> String -> String -> String Source

With the variable name and the variable value search for an abbreviation or return an empty string.

getTerm :: Bool -> Form -> String -> State EvalState String Source

If the first parameter is `True` the plural form will be retrieved.

getStringVar :: String -> State EvalState String Source

getDateVar :: String -> State EvalState [RefDate]Source

getLocVar :: State EvalState (String, String)Source

getVar :: a -> (Value -> a) -> String -> State EvalState aSource

getAgents :: String -> State EvalState [Agent]Source

getAgents' :: String -> State EvalState [Agent]Source

getStringValue :: Value -> String Source

getOptionVal :: String -> [Option] -> String Source

isOptionSet :: String -> [Option] -> Bool Source

isTitleVar :: String -> Bool Source

isTitleShortVar :: String -> Bool Source

getTitleShort :: String -> State EvalState String Source

isVarSet :: String -> State EvalState Bool Source

withRefMap :: (ReferenceMap -> a) -> State EvalState aSource

formatVariable :: String -> String Source

Convert variable to lower case, translating underscores (_) to dashes (-)

consumeVariable :: String -> State EvalState ()Source

consuming :: State EvalState a -> State EvalState aSource

when' :: Monad m => m Bool -> m [a] -> m [a]Source

whenElse :: Monad m => m Bool -> m a -> m a -> m aSource

concatMapM :: (Monad m, Functor m, Eq b) => (a -> m [b]) -> [a] -> m [b]Source

trace :: String -> State EvalState ()Source