HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleoptparse-applicative-0.18.1.0Haskell98

Options.Applicative.Help.Chunk

Synopsis
newtypenewtype Chunk a

The free monoid on a semigroup a.

Constructors

Instances9Monad, Functor, Applicative, Alternative, MonadPlus, Eq, …
  • Monad ChunkDefined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Functor ChunkDefined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Applicative ChunkDefined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Alternative ChunkDefined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • MonadPlus ChunkDefined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Eq a => Eq (Chunk a)Defined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Show a => Show (Chunk a)Defined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Semigroup a => Semigroup (Chunk a)Defined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
  • Semigroup a => Monoid (Chunk a)Defined in optparse-applicative-0.18.1.0 · Options.Applicative.Help.Chunk
valuechunked :: (a -> a -> a) -> Chunk a -> Chunk a -> Chunk a

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

Note that this is not the same as liftA2.

valueisEmpty :: Chunk a -> Bool

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 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
valueextractChunk :: Monoid a => Chunk a -> a

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