Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Column = Natural
- type Indent = Column
- type Width = Natural
- type SGR = SGR
- newtype Line d = Line d
- unLine :: Line d -> d
- newtype Word d = Word d
- unWord :: Word d -> d
- class From a d where
- from :: a -> d
- runTextBuilder :: Builder -> Text
- class Lengthable d where
- class Monoid d => Spaceable d where
- intercalate :: (Foldable f, Monoid d) => d -> f d -> d
- replicate :: Monoid d => Int -> d -> d
- between :: Semigroup d => d -> d -> d -> d
- parens :: Semigroup d => From (Word Char) d => d -> d
- braces :: Semigroup d => From (Word Char) d => d -> d
- brackets :: Semigroup d => From (Word Char) d => d -> d
- angles :: Semigroup d => From (Word Char) d => d -> d
- class (Lengthable d, Monoid d) => Splitable d where
- class Decorable d where
- class Colorable16 d where
- reverse :: d -> d
- black :: d -> d
- red :: d -> d
- green :: d -> d
- yellow :: d -> d
- blue :: d -> d
- magenta :: d -> d
- cyan :: d -> d
- white :: d -> d
- blacker :: d -> d
- redder :: d -> d
- greener :: d -> d
- yellower :: d -> d
- bluer :: d -> d
- magentaer :: d -> d
- cyaner :: d -> d
- whiter :: d -> d
- onBlack :: d -> d
- onRed :: d -> d
- onGreen :: d -> d
- onYellow :: d -> d
- onBlue :: d -> d
- onMagenta :: d -> d
- onCyan :: d -> d
- onWhite :: d -> d
- onBlacker :: d -> d
- onRedder :: d -> d
- onGreener :: d -> d
- onYellower :: d -> d
- onBluer :: d -> d
- onMagentaer :: d -> d
- onCyaner :: d -> d
- onWhiter :: d -> d
- xmlSGR :: Semigroup d => From String d => String -> d -> d
- class Spaceable d => Indentable d where
- class Listable d where
- ul :: Traversable f => f d -> d
- ol :: Traversable f => f d -> d
- class Wrappable d where
- setWidth :: Maybe Width -> d -> d
- breakpoint :: d
- breakspace :: d
- breakalt :: d -> d -> d
- endline :: d
- class Justifiable d where
- justify :: d -> d
- class Trans repr where
- type UnTrans repr :: Type
- noTrans :: UnTrans repr -> repr
- unTrans :: repr -> UnTrans repr
- noTrans1 :: (UnTrans repr -> UnTrans repr) -> repr -> repr
- noTrans2 :: (UnTrans repr -> UnTrans repr -> UnTrans repr) -> repr -> repr -> repr
- noTrans3 :: (UnTrans repr -> UnTrans repr -> UnTrans repr -> UnTrans repr) -> repr -> repr -> repr -> repr
Helper types
Type Line
Line d |
Instances
Eq d => Eq (Line d) Source # | |
Show d => Show (Line d) Source # | |
Lengthable d => Lengthable (Line d) Source # | |
From d Builder => From (Line d) Builder Source # | |
From d Text => From (Line d) Text Source # | |
From d Text => From (Line d) Text Source # | |
From d String => From (Line d) String Source # | |
(From (Word s) d, Lengthable s, Spaceable d, Splitable s) => From (Line s) (Plain d) Source # | |
Type Word
Word d |
Instances
Eq d => Eq (Word d) Source # | |
Show d => Show (Word d) Source # | |
Semigroup d => Semigroup (Word d) Source # | |
Lengthable d => Lengthable (Word d) Source # | |
From d Builder => From (Word d) Builder Source # | |
From d Text => From (Word d) Text Source # | |
From d Text => From (Word d) Text Source # | |
From d String => From (Word d) String Source # | |
From [SGR] d => From [SGR] (Word d) Source # | |
(From (Word s) d, Semigroup d, Lengthable s) => From (Word s) (Plain d) Source # | |
Class From
Nothing
Instances
runTextBuilder :: Builder -> Text Source #
Class Lengthable
class Lengthable d where Source #
Instances
Lengthable Char Source # | |
Lengthable String Source # | |
Lengthable Text Source # | |
Lengthable Text Source # | |
Lengthable d => Lengthable (Word d) Source # | |
Lengthable d => Lengthable (Line d) Source # | |
Lengthable d => Lengthable (PlainChunk d) Source # | |
Defined in Symantic.Document.Plain width :: PlainChunk d -> Column Source # nullWidth :: PlainChunk d -> Bool Source # |
Class Spaceable
class Monoid d => Spaceable d where Source #
Nothing
spaces :: Column -> d Source #
unlines :: Foldable f => f (Line d) -> d Source #
unwords :: Foldable f => Functor f => f (Word d) -> d Source #
catLines :: Foldable f => Functor f => f (Line d) -> d Source #
(<+>) :: d -> d -> d infixr 6 Source #
(</>) :: d -> d -> d infixr 6 Source #
Instances
intercalate :: (Foldable f, Monoid d) => d -> f d -> d Source #
Class Splitable
class (Lengthable d, Monoid d) => Splitable d where Source #
break :: (Char -> Bool) -> d -> (d, d) Source #
span :: (Char -> Bool) -> d -> (d, d) Source #
lines :: d -> [Line d] Source #
words :: d -> [Word d] Source #
linesNoEmpty :: d -> [Line d] Source #
wordsNoEmpty :: d -> [Word d] Source #
splitOnChar :: (Char -> Bool) -> d -> [d] Source #
splitOnCharNoEmpty :: (Char -> Bool) -> d -> [d] Source #
Instances
Class Decorable
Class Colorable16
class Colorable16 d where Source #
Nothing
onYellower :: d -> d Source #
default onYellower :: Colorable16 (UnTrans d) => Trans d => d -> d Source #
onMagentaer :: d -> d Source #
default onMagentaer :: Colorable16 (UnTrans d) => Trans d => d -> d Source #
Instances
Class Indentable
class Spaceable d => Indentable d where Source #
Nothing
setIndent :: d -> Indent -> d -> d Source #
incrIndent :: d -> Indent -> d -> d Source #
(
make incrIndent
p ind d)d
uses current Indent
plus ind
as Indent
level.
Appending p
to the current Indent
text.
default incrIndent :: Indentable (UnTrans d) => Trans d => d -> Indent -> d -> d Source #
hang :: Indent -> d -> d Source #
fill :: Width -> d -> d Source #
fillOrBreak :: Width -> d -> d Source #
(
write fillOrBreak
w d)d
,
then if d
is not wider than w
, write the difference with spaces
otherwise write a newline
indented to to the start Column
of d
plus w
.
default fillOrBreak :: Indentable (UnTrans d) => Trans d => Width -> d -> d Source #
Instances
Spaceable d => Indentable (Plain d) Source # | |
Defined in Symantic.Document.Plain |
class Listable d where Source #
Nothing
ul :: Traversable f => f d -> d Source #
ol :: Traversable f => f d -> d Source #
Class Wrappable
Class Justifiable
class Justifiable d where Source #
Class Trans
class Trans repr where Source #
noTrans :: UnTrans repr -> repr Source #
Lift a repr to the transformer's.
unTrans :: repr -> UnTrans repr Source #
Unlift a repr from the transformer's.
noTrans1 :: (UnTrans repr -> UnTrans repr) -> repr -> repr Source #
Identity transformation for a unary symantic method.
noTrans2 :: (UnTrans repr -> UnTrans repr -> UnTrans repr) -> repr -> repr -> repr Source #
Identity transformation for a binary symantic method.
noTrans3 :: (UnTrans repr -> UnTrans repr -> UnTrans repr -> UnTrans repr) -> repr -> repr -> repr -> repr Source #
Identity transformation for a ternary symantic method.