HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletrifecta-2.1.4Haskell2010

Text.Trifecta.Rendering

The type for Lines will very likely change over time, to enable drawing lit up multi-character versions of control characters for ^Z, ^[, 0xff, etc. This will make for much nicer diagnostics when working with protocols.

  • 8 types
  • 6 classes
  • 17 values
  • Packagetrifecta-2.1.4
  • Exports31
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceRendering.hs
datadata Rendering
#

A Rendering is a canvas of text that output can be written to.

Constructors

  • Rendering
    • _renderingDelta :: !Delta

      focus, the render will keep this visible

    • _renderingLineLen :: !Int64

      actual line length

    • _renderingLineBytes :: !Int64

      line length in bytes

    • _renderingLine :: Lines -> Lines
    • _renderingOverlays :: Delta -> Lines -> Lines
Instances11Show, Semigroup, Monoid, HasRendering, Renderable, HasDelta, …
valuenullRendering :: Rendering -> Bool
#

Is the Rendering empty?

Example1 expression
nullRendering emptyRenderingTrue
Example1 expression
nullRendering exampleRenderingFalse
classclass Renderable t where
#

Methods

Instances7Renderable, …
datadata Rendered a
#

Constructors

Instances9Functor, Foldable, Traversable, Comonad, ComonadApply, Show, …

Carets

7 declarations
datadata Caret
#

A Caret marks a point in the input with a simple ^ character.

Example1 expression
unAnnotate (prettyRendering (addCaret (Columns 35 35) exampleRendering))1 | int main(int argc, char ** argv) { int; }<EOF>  |                                    ^

Constructors

Instances13Eq, Data, Ord, Show, Generic, Semigroup, …
datadata Careted a
#

Constructors

Instances17Functor, Foldable, Traversable, Comonad, ComonadApply, Eq, …

Spans

6 declarations
datadata Span
#

A Span marks a range of input characters. If Caret is a point, then Span is a line.

Example1 expression
unAnnotate (prettyRendering (addSpan (Columns 35 35) (Columns 38 38) exampleRendering))1 | int main(int argc, char ** argv) { int; }<EOF>  |                                    ~~~

Constructors

Instances11Eq, Data, Ord, Show, Generic, Semigroup, …
datadata Spanned a
#

Annotate an arbitrary piece of data with a Span, typically its corresponding input location.

Constructors

Instances15Functor, Foldable, Traversable, Comonad, ComonadApply, Eq, …

Fixits

4 declarations
datadata Fixit
#

A Fixit is a Span with a suggestion.

Example1 expression
unAnnotate (prettyRendering (addFixit (Columns 35 35) (Columns 38 38) "Fix this!" exampleRendering))1 | int main(int argc, char ** argv) { int; }<EOF>  |                                    ~~~  |                                    Fix this!

Constructors

Instances11Eq, Data, Ord, Show, Generic, Hashable, …

Drawing primitives

4 declarations
valuedraw
  1. :: [SGR]

    ANSI style to use

  2. -> Int

    Line; 0 is at the top

  3. -> Int64

    Column; 0 is on the left

  4. -> String

    Data to be written

  5. -> Lines

    Canvas to draw on

  6. -> Lines
#