optparse-applicative-0.13.2.0: Utilities and combinators for parsing command line options

Options.Applicative.Help.Chunk

Synopsis

# Documentation

mappendWith :: Monoid a => a -> a -> a -> a Source #

newtype Chunk a Source #

The free monoid on a semigroup a.

Constructors

 Chunk FieldsunChunk :: Maybe a

Instances

 Source # Methods(>>=) :: Chunk a -> (a -> Chunk b) -> Chunk b #(>>) :: Chunk a -> Chunk b -> Chunk b #return :: a -> Chunk a #fail :: String -> Chunk a # Source # Methodsfmap :: (a -> b) -> Chunk a -> Chunk b #(<\$) :: a -> Chunk b -> Chunk a # Source # Methodspure :: a -> Chunk a #(<*>) :: Chunk (a -> b) -> Chunk a -> Chunk b #(*>) :: Chunk a -> Chunk b -> Chunk b #(<*) :: Chunk a -> Chunk b -> Chunk a # Source # Methodsempty :: Chunk a #(<|>) :: Chunk a -> Chunk a -> Chunk a #some :: Chunk a -> Chunk [a] #many :: Chunk a -> Chunk [a] # Source # Methodsmzero :: Chunk a #mplus :: Chunk a -> Chunk a -> Chunk a # Eq a => Eq (Chunk a) Source # Methods(==) :: Chunk a -> Chunk a -> Bool #(/=) :: Chunk a -> Chunk a -> Bool # Show a => Show (Chunk a) Source # MethodsshowsPrec :: Int -> Chunk a -> ShowS #show :: Chunk a -> String #showList :: [Chunk a] -> ShowS # Monoid a => Monoid (Chunk a) Source # Methodsmempty :: Chunk a #mappend :: Chunk a -> Chunk a -> Chunk a #mconcat :: [Chunk a] -> Chunk a #

chunked :: (a -> a -> a) -> Chunk a -> Chunk a -> Chunk a Source #

Given a semigroup structure on a, return a monoid structure on 'Chunk a'.

Note that this is not the same as liftA2.

listToChunk :: Monoid a => [a] -> Chunk a Source #

Concatenate a list into a Chunk. listToChunk satisfies:

isEmpty . listToChunk = null
listToChunk = mconcat . fmap pure

Concatenate two Chunks with a space in between. If one is empty, this just returns the other one.

Unlike <+> for Doc, this operation has a unit element, namely the empty Chunk.

Concatenate two Chunks with a softline in between. This is exactly like <<+>>, but uses a softline instead of a space.

Concatenate Chunks vertically.

Concatenate Chunks vertically separated by empty lines.

isEmpty :: Chunk a -> Bool Source #

Whether a Chunk is empty. Note that something like 'pure mempty' is not considered an empty chunk, even though the underlying Doc is empty.

Convert a String into a Chunk. This satisfies:

isEmpty . stringChunk = null
extractChunk . stringChunk = string

Convert a paragraph into a Chunk. The resulting chunk is composed by the words of the original paragraph separated by softlines, so it will be automatically word-wrapped when rendering the underlying document.

This satisfies:

isEmpty . paragraph = null . words

extractChunk :: Monoid a => Chunk a -> a Source #

Part of a constrained comonad instance.

This is the counit of the adjunction between Chunk and the forgetful functor from monoids to semigroups. It satisfies:

extractChunk . pure = id
extractChunk . fmap pure = id

tabulate :: [(Doc, Doc)] -> Chunk Doc Source #

Display pairs of strings in a table.