Safe Haskell | Safe-Inferred |
---|---|
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:
- Right identity
x
<>
mempty
= x- Left identity
mempty
<>
x = x- Associativity
x
(<>
(y<>
z) = (x<>
y)<>
zSemigroup
law)- Concatenation
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
>>>
"Hello world" <> mempty
"Hello world"
An associative operation
NOTE: This method is redundant and has the default
implementation
since base-4.11.0.0.
Should it be implemented manually, since mappend
= (<>
)mappend
is a synonym for
(<>
), it is expected that the two functions are defined the same
way. In a future GHC release mappend
will be removed from Monoid
.
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.
>>>
mconcat ["Hello", " ", "Haskell", "!"]
"Hello Haskell!"
Instances
Monoid LaTeX Source # | |
Monoid TeXCheck Source # | |
Monoid All | Since: base-2.1 |
Monoid Any | Since: base-2.1 |
Monoid ByteString | |
Defined in Data.ByteString.Internal mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString # | |
Monoid ByteString | |
Defined in Data.ByteString.Lazy.Internal mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString # | |
Monoid ShortByteString | |
Defined in Data.ByteString.Short.Internal mappend :: ShortByteString -> ShortByteString -> ShortByteString # mconcat :: [ShortByteString] -> ShortByteString # | |
Monoid IntSet | |
Monoid ByteArray | |
Monoid Ordering | Since: base-2.1 |
Monoid Doc | |
Monoid Builder | |
Monoid () | Since: base-2.1 |
Monoid a => Monoid (Identity a) | Since: base-4.9.0.0 |
Ord a => Monoid (Max a) | Since: base-4.8.0.0 |
Ord a => Monoid (Min a) | Since: base-4.8.0.0 |
Monoid (First a) | Since: base-2.1 |
Monoid (Last a) | Since: base-2.1 |
(Ord a, Bounded a) => Monoid (Max a) | Since: base-4.9.0.0 |
(Ord a, Bounded a) => Monoid (Min 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 # | |
Monoid a => Monoid (Dual a) | Since: base-2.1 |
Monoid (Endo a) | Since: base-2.1 |
Num a => Monoid (Product a) | Since: base-2.1 |
Num a => Monoid (Sum a) | Since: base-2.1 |
Monoid p => Monoid (Par1 p) | Since: base-4.12.0.0 |
Monoid (IntMap a) | |
Monoid (Seq a) | |
Monoid (MergeSet a) | |
Ord a => Monoid (Set a) | |
Monoid a => Monoid (IO a) | Since: base-4.9.0.0 |
Monoid a => Monoid (Matrix a) | |
Monoid (Doc a) | |
Monoid (Doc ann) |
|
Monoid (Array a) | |
Monoid a => Monoid (Q a) | Since: template-haskell-2.17.0.0 |
Monoid (Vector a) | |
Semigroup a => Monoid (Maybe a) | Lift a semigroup into Since 4.11.0: constraint on inner Since: base-2.1 |
Monoid a => Monoid (a) | Since: base-4.15 |
Monoid [a] | Since: base-2.1 |
(Monad m, Monoid a) => Monoid (LaTeXT m a) Source # | |
Monoid (Proxy s) | Since: base-4.7.0.0 |
Monoid (U1 p) | Since: base-4.12.0.0 |
Ord k => Monoid (Map k v) | |
Monoid b => Monoid (a -> b) | Since: base-2.1 |
(Monoid a, Monoid b) => Monoid (a, b) | Since: base-2.1 |
(Applicative m, Semigroup (m a), Monoid (m a), a ~ ()) => Monoid (ReferenceQueryT r m a) Source # | |
Defined in Text.LaTeX.Packages.BibLaTeX mempty :: ReferenceQueryT r m a # mappend :: ReferenceQueryT r m a -> ReferenceQueryT r m a -> ReferenceQueryT r m a # mconcat :: [ReferenceQueryT r m a] -> ReferenceQueryT r m a # | |
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 |
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 (f a), Monoid (g a)) => Monoid (Product f g a) | Since: base-4.16.0.0 |
(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) | Since: base-4.12.0.0 |
Monoid c => Monoid (K1 i c p) | Since: base-4.12.0.0 |
(Monoid a, Semigroup (ParsecT s u m a)) => Monoid (ParsecT s u m a) | The Since: parsec-3.1.12 |
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | Since: base-2.1 |
Monoid (f (g a)) => Monoid (Compose f g a) | Since: base-4.16.0.0 |
Monoid (f (g p)) => Monoid ((f :.: g) p) | Since: base-4.12.0.0 |
Monoid (f p) => Monoid (M1 i c f 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 |