Copyright | (c) Ogma Project 2016 |
---|---|
License | MIT |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides the Typography
datatype along with two default instances
for French and English.
- data Space
- data Typography a = Typography {}
- beforeAtom :: Typography a -> Atom a -> Space
- afterAtom :: Typography a -> Atom a -> Space
- normalizeAtom :: Typography a -> Atom a -> a
- frenchTypo :: IsString a => Typography a
- englishTypo :: IsString a => Typography a
Inner spaces representation
Deal with typographic spaces, especially when it comes to separating two texts. Because Space derives Ord, it is possible to use min and max to determine which one to use in case of a conflict.
Typography definition
data Typography a Source #
A Typography is a data type that tells the caller what space should be privileged before and after a text.
Typography | |
|
Functor Typography Source # | Apply the function to each |
beforeAtom :: Typography a -> Atom a -> Space Source #
From a Typography, it gives the space to privilege before the input Text.
afterAtom :: Typography a -> Atom a -> Space Source #
From a Typography, it gives the space to privilege after the input Text.
normalizeAtom :: Typography a -> Atom a -> a Source #
Normalize the input in order to add it to a generated Text.
Ready-to-use Typography
frenchTypo :: IsString a => Typography a Source #
A proposal for the French typography. It can be used with several generation
approaches, as it remains very generic. Requires the output type to be an
instance of IsString
.
englishTypo :: IsString a => Typography a Source #
A proposal for the English typography. It can be used with several generation
approaches, as it remains very generic. Requires the output type to be an
instance of IsString
.