cabal-gild-1.3.1.0: Formats package descriptions.
Safe HaskellSafe-Inferred
LanguageHaskell2010

CabalGild.Unstable.Type.Block

Description

This module defines the Block data type.

Synopsis

Documentation

data Block Source #

A block of text, which is made up of multiple lines and can have blank lines before and/or after it.

Constructors

Block 

Fields

Instances

Instances details
Monoid Block Source #

The empty block has no lines and also no blank lines before or after.

Instance details

Defined in CabalGild.Unstable.Type.Block

Methods

mempty :: Block #

mappend :: Block -> Block -> Block #

mconcat :: [Block] -> Block #

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.

Instance details

Defined in CabalGild.Unstable.Type.Block

Methods

(<>) :: Block -> Block -> Block #

sconcat :: NonEmpty Block -> Block #

stimes :: Integral b => b -> Block -> Block #

Show Block Source # 
Instance details

Defined in CabalGild.Unstable.Type.Block

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

Eq Block Source # 
Instance details

Defined in CabalGild.Unstable.Type.Block

Methods

(==) :: Block -> Block -> Bool #

(/=) :: Block -> Block -> Bool #

fromLine :: Line -> Block Source #

Converts a single line into a block without blank lines before or after.

isEmpty :: Block -> Bool Source #

Returns True if the block has no lines.

lineAfterLens :: Lens' Block Bool Source #

A lens for the lineAfter field.

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.