| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
CabalGild.Type.Block
Description
This module defines the Block data type.
Synopsis
- data Block = Block {}
- fromLine :: Line -> Block
- isEmpty :: Block -> Bool
- lineAfterLens :: Lens' Block Bool
- lineBeforeLens :: Lens' Block Bool
- toByteString :: Block -> ByteString
Documentation
A block of text, which is made up of multiple lines and can have blank lines before and/or after it.
Constructors
| Block | |
Instances
| Monoid Block Source # | The empty block has no lines and also no blank lines before or after. |
| Semigroup Block Source # | Joins two blocks together by adding a blank line between them if necessary. (A blank line is necessary if either block needs a space.) If either block is empty, the other block is returned. |
| Show Block Source # | |
| Eq Block Source # | |
fromLine :: Line -> Block Source #
Converts a single line into a block without blank lines before or after.
lineBeforeLens :: Lens' Block Bool Source #
A lens for the lineBefore field.
toByteString :: Block -> ByteString Source #
Converts a block into a ByteString by joining the lines
together with newline characters. Note that unline unlines, there will be
no trailing newline unless lineAfter is True.