brick-0.1: A declarative terminal user interface library

Safe HaskellNone
LanguageHaskell2010

Brick.Types

Description

Basic types used by this library.

Synopsis

Documentation

data Location Source

A terminal screen location.

Constructors

Location 

Fields

loc :: (Int, Int)

(Column, Row)

class TerminalLocation a where Source

The class of types that behave like terminal locations.

Methods

columnL :: Lens' a Int Source

Get the column out of the value

column :: a -> Int Source

rowL :: Lens' a Int Source

Get the row out of the value

row :: a -> Int Source

data CursorLocation Source

A cursor location. These are returned by the rendering process.

Constructors

CursorLocation 

Fields

cursorLocation :: !Location

The location

cursorLocationName :: !(Maybe Name)

The name of the widget associated with the location

class HandleEvent a where Source

The class of types that provide some basic event-handling.

Methods

handleEvent :: Event -> a -> a Source

Handle a Vty event

newtype Name Source

Names of things. Used to name cursor locations, widgets, and viewports.

Constructors

Name String 

suffixLenses :: Name -> DecsQ Source

A template haskell function to build lenses for a record type. This function differs from the makeLenses function in that it does not require the record fields to be prefixed with underscores and it adds an L suffix to lens names to make it clear that they are lenses.