Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exports those minimal things you need to work with HaTeX. Those things are:
- The
LaTeX
datatype. - The
<>
operator, to appendLaTeX
values. - The Text.LaTeX.Base.Render module, to render a
LaTeX
value intoText
. - The Text.LaTeX.Base.Types module, which contains several types used by other modules.
- The Text.LaTeX.Base.Commands module, which exports the LaTeX standard commands and environments.
- The Text.LaTeX.Base.Writer module, to work with the monad interface of the library.
- The Text.LaTeX.Base.Texy module, which exports the
Texy
class. Useful to pretty-print values in LaTeX form.
Synopsis
- data LaTeX
- protectString :: String -> String
- protectText :: Text -> Text
- module Text.LaTeX.Base.Render
- module Text.LaTeX.Base.Types
- module Text.LaTeX.Base.Commands
- module Text.LaTeX.Base.Writer
- module Text.LaTeX.Base.Texy
- class Semigroup a => Monoid a where
- (<>) :: Semigroup a => a -> a -> a
LaTeX
datatype
Type of LaTeX
blocks.
Instances
Escaping reserved characters
Internal re-exports
module Text.LaTeX.Base.Render
module Text.LaTeX.Base.Types
module Text.LaTeX.Base.Commands
module Text.LaTeX.Base.Writer
module Text.LaTeX.Base.Texy
Monoids
Since the Monoid
instance is the only way to append LaTeX
values, a re-export of the Monoid
class is given here for convenience.
class Semigroup a => Monoid a where #
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
x
<>
mempty
= xmempty
<>
x = xx
(<>
(y<>
z) = (x<>
y)<>
zSemigroup
law)mconcat
=foldr
'(<>)'mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances.
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 newtype
s and make those instances
of Monoid
, e.g. Sum
and Product
.
NOTE: Semigroup
is a superclass of Monoid
since base-4.11.0.0.
Identity of mappend
An associative operation
NOTE: This method is redundant and has the default
implementation
since base-4.11.0.0.mappend
= '(<>)'
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 | Since: base-2.1 |
Monoid () | Since: base-2.1 |
Monoid All | Since: base-2.1 |
Monoid Any | Since: base-2.1 |
Monoid ByteString | |
Defined in Data.ByteString.Lazy.Internal mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString # | |
Monoid ByteString | |
Defined in Data.ByteString.Internal mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString # | |
Monoid IntSet | |
Monoid Doc | |
Monoid LaTeX Source # | Method |
Monoid TeXCheck Source # | |
Monoid [a] | Since: base-2.1 |
Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner Since: base-2.1 |
Monoid a => Monoid (IO a) | Since: base-4.9.0.0 |
Monoid p => Monoid (Par1 p) | Since: base-4.12.0.0 |
(Ord a, Bounded a) => Monoid (Min a) | Since: base-4.9.0.0 |
(Ord a, Bounded a) => Monoid (Max a) | Since: base-4.9.0.0 |
Monoid m => Monoid (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup mempty :: WrappedMonoid m # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # mconcat :: [WrappedMonoid m] -> WrappedMonoid m # | |
Semigroup a => Monoid (Option a) | Since: base-4.9.0.0 |
Monoid a => Monoid (Identity a) | Since: base-4.9.0.0 |
Monoid (First a) | Since: base-2.1 |
Monoid (Last a) | Since: base-2.1 |
Monoid a => Monoid (Dual a) | Since: base-2.1 |
Monoid (Endo a) | Since: base-2.1 |
Num a => Monoid (Sum a) | Since: base-2.1 |
Num a => Monoid (Product a) | Since: base-2.1 |
Monoid (IntMap a) | |
Monoid (Seq a) | |
Ord a => Monoid (Set a) | |
Monoid (Vector a) | |
Monoid a => Monoid (Matrix a) | |
Monoid (Doc a) | |
Monoid (Array a) | |
(Hashable a, Eq a) => Monoid (HashSet a) | |
Monoid (Doc e) | |
Monoid (MergeSet a) | |
Monoid b => Monoid (a -> b) | Since: base-2.1 |
Monoid (U1 p) | Since: base-4.12.0.0 |
(Monoid a, Monoid b) => Monoid (a, b) | Since: base-2.1 |
Monoid (Proxy s) | Since: base-4.7.0.0 |
Ord k => Monoid (Map k v) | |
(Eq k, Hashable k) => Monoid (HashMap k v) | |
(Monad m, Monoid a) => Monoid (LaTeXT m a) Source # | |
Monoid (f p) => Monoid (Rec1 f p) | Since: base-4.12.0.0 |
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | Since: base-2.1 |
Monoid a => Monoid (Const a b) | Since: base-4.9.0.0 |
(Applicative f, Monoid a) => Monoid (Ap f a) | Since: base-4.12.0.0 |
Alternative f => Monoid (Alt f a) | Since: base-4.8.0.0 |
(Semigroup a, Monoid a) => Monoid (Tagged s a) | |
Monoid c => Monoid (K1 i c p) | Since: base-4.12.0.0 |
(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) | Since: base-4.12.0.0 |
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | Since: base-2.1 |
(Monoid a, Semigroup (ParsecT s u m a)) => Monoid (ParsecT s u m a) | The Since: parsec-3.1.12 |
Monoid (f p) => Monoid (M1 i c f p) | Since: base-4.12.0.0 |
Monoid (f (g p)) => Monoid ((f :.: g) p) | Since: base-4.12.0.0 |
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) | Since: base-2.1 |