hlatex-0.1: A library to build valid LaTeX files

Language.LaTeX

Contents

Synopsis

Types

data Loc Source

Instances

data Named a Source

Instances

data Pos Source

data Row cell Source

Instances

Functor Row 
Typeable1 Row 
Foldable Row 
Traversable Row 
Eq cell => Eq (Row cell) 
Data cell => Data (Row cell) 
Show cell => Show (Row cell) 

data Key Source

Instances

data Encoding Source

Type for encodings used in commands like. usepackage[utf8]{inputenc}, that we can express as useInputenc utf8.

Internal types

data Arg a Source

Instances

Functor Arg 
Typeable1 Arg 
Foldable Arg 
Traversable Arg 
Eq a => Eq (Arg a) 
Data a => Data (Arg a) 
Show a => Show (Arg a) 

Writer type aliases

Utils

(!$) :: Monoid b => (a -> b) -> a -> Writer b ()Source

($?) :: (a -> b) -> Writer a () -> bSource

(!$?) :: Monoid b => (a -> b) -> Writer a () -> Writer b ()Source

tell :: MonadWriter w m => w -> m ()

tell w is an action that produces the output w.

type Writer w = WriterT w Identity

A writer monad parameterized by the type w of output to accumulate.

The return function produces the output mempty, while >>= combines the outputs of the subcomputations using mappend.

class Monoid a where

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

  • mappend mempty x = x
  • mappend x mempty = x
  • mappend x (mappend y z) = mappend (mappend x y) z
  • mconcat = foldr mappend mempty

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Minimal complete definition: mempty and mappend.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

Methods

mempty :: a

Identity of mappend

mappend :: a -> a -> a

An associative operation

mconcat :: [a] -> a

Fold a list using the monoid. For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances

Monoid Ordering 
Monoid () 
Monoid All 
Monoid Any 
Monoid ByteString 
Monoid ByteString 
Monoid Doc 
Monoid Text 
Monoid Text 
Monoid MathItem 
Monoid LatexLength 
Monoid MathItm 
Monoid ParItm 
Monoid Star 
Monoid LatexItm 
Monoid PreambleItm 
Monoid [a] 
Monoid a => Monoid (Dual a) 
Monoid (Endo a) 
Num a => Monoid (Sum a) 
Num a => Monoid (Product a) 
Monoid (First a) 
Monoid (Last a) 
Monoid a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s  S." Since there is no "Semigroup" typeclass providing just mappend, we use Monoid instead.

Monoid (IntMap a) 
Ord a => Monoid (Set a) 
Monoid a => Monoid (LatexM a) 
Monoid b => Monoid (a -> b) 
(Monoid a, Monoid b) => Monoid (a, b) 
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) 
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) 
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)