trifecta-1.1: A modern parser combinator library with convenient diagnostics

Portabilitynon-portable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellNone

Text.Trifecta.Rendering

Contents

Description

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.

Synopsis

Documentation

class Source t whereSource

Methods

source :: t -> (Int64, Int64, Lines -> Lines)Source

rendered :: Source s => Delta -> s -> RenderingSource

create a drawing surface

Carets

data Caret Source

 In file included from baz.c:9
 In file included from bar.c:4
 foo.c:8:36: note
 int main(int argc, char ** argv) { int; }
                                    ^

Constructors

Caret !Delta !ByteString 

class HasCaret t whereSource

Methods

caret :: Lens' t CaretSource

Instances

data Careted a Source

Constructors

a :^ Caret 

Instances

Functor Careted 
Typeable1 Careted 
Foldable Careted 
Traversable Careted 
Comonad Careted 
ComonadApply Careted 
Eq a => Eq (Careted a) 
Data a => Data (Careted a) 
Ord a => Ord (Careted a) 
Show a => Show (Careted a) 
Generic (Careted a) 
Hashable a => Hashable (Careted a) 
HasDelta (Careted a) 
HasBytes (Careted a) 
HasCaret (Careted a) 
Renderable (Careted a) 
Reducer (Careted a) Rendering 

Spans

data Span Source

Constructors

Span !Delta !Delta !ByteString 

Instances

class HasSpan t whereSource

Methods

span :: Lens' t SpanSource

data Spanned a Source

Constructors

a :~ Span 

Instances

Functor Spanned 
Typeable1 Spanned 
Foldable Spanned 
Traversable Spanned 
Comonad Spanned 
ComonadApply Spanned 
Eq a => Eq (Spanned a) 
Data a => Data (Spanned a) 
Ord a => Ord (Spanned a) 
Show a => Show (Spanned a) 
Generic (Spanned a) 
Hashable a => Hashable (Spanned a) 
HasSpan (Spanned a) 
Renderable (Spanned a) 
Reducer (Spanned a) Rendering 

addSpan :: Delta -> Delta -> Rendering -> RenderingSource

 int main(int argc, char ** argv) { int; }
                                    ^~~

Fixits

Drawing primitives

type Lines = Array (Int, Int64) ([SGR], Char)Source

draw :: [SGR] -> Int -> Int64 -> String -> Lines -> LinesSource