The brick package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Write terminal applications painlessly with brick! You write an event handler and a drawing function and the library does the rest.

module Main where

import Brick

ui :: Widget ()
ui = str "Hello, world!"

main :: IO ()
main = simpleMain ui

To get started, see:

This package deprecates vty-ui.


[Skip to ReadMe]

Properties

Versions0.1, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.3, 0.3.1, 0.4, 0.4.1, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.15.1, 0.15.2, 0.16, 0.17, 0.17.1, 0.17.2, 0.18, 0.19, 0.20, 0.20.1, 0.21, 0.22, 0.23, 0.24, 0.24.1, 0.24.2, 0.24.2, 0.25, 0.26, 0.26.1, 0.27, 0.28, 0.29
Change logCHANGELOG.md
Dependenciesbase (<=5), brick, containers, contravariant, data-clist (>=0.1), deepseq (>=1.3 && <1.5), dlist, microlens (>=0.3.0.0), microlens-mtl, microlens-th, stm (>=2.4), template-haskell, text, text-zipper (>=0.7.1), transformers, vector, vty (>=5.15), word-wrap (>=0.2) [details]
LicenseBSD3
Copyright(c) Jonathan Daugherty 2015-2016
AuthorJonathan Daugherty <cygnus@foobox.com>
MaintainerJonathan Daugherty <cygnus@foobox.com>
CategoryGraphics
Home pagehttps://github.com/jtdaugherty/brick/
Bug trackerhttps://github.com/jtdaugherty/brick/issues
Source repositoryhead: git clone git://github.com/jtdaugherty/brick.git
Executablesbrick-progressbar-demo, brick-border-demo, brick-edit-demo, brick-hello-world-demo, brick-fill-demo, brick-custom-event-demo, brick-list-demo, brick-markup-demo, brick-attr-demo, brick-padding-demo, brick-suspend-resume-demo, brick-layer-demo, brick-mouse-demo, brick-dialog-demo, brick-viewport-scroll-demo, brick-visibility-demo, brick-cache-demo, brick-text-wrap-demo, brick-readme-demo
UploadedMon Aug 28 03:08:50 UTC 2017 by JonathanDaugherty

Modules

[Index]

Flags

NameDescriptionDefaultType
demos

Build demonstration programs

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for brick-0.24.2

[back to package description]

brick

Build Status

brick is a Haskell terminal user interface programming library in the style of gloss. This means you write a function that describes how your user interface should look, but the library takes care of a lot of the book-keeping that so commonly goes into writing such programs.

brick exposes a declarative API. Unlike most GUI toolkits which require you to write a long and tedious sequence of "create a widget, now bind an event handler", brick just requires you to describe your interface using a set of declarative combinators. Then you provide a function to transform your application state when input or other kinds of events arrive.

Under the hood, this library builds upon vty, so some knowledge of Vty will be helpful in using this library.

This library deprecates vty-ui.

Example

Here's an example interface (see programs/ReadmeDemo.hs):

withBorderStyle unicode $
borderWithLabel (str "Hello!") $
(center (str "Left") <+> vBorder <+> center (str "Right"))

Result:

┌─────────Hello!─────────┐
│           │            │
│           │            │
│   Left    │   Right    │
│           │            │
│           │            │
└────────────────────────┘

Featured Projects

To give you an idea of what some people have done with brick, take a look at these projects:

Getting Started

TLDR:

$ cabal sandbox init
$ cabal install -j -f demos
$ .cabal-sandbox/bin/brick-???-demo

To get started, see the user guide.

Documentation

Documentation for brick comes in a variety of forms:

Feature Overview

brick comes with a bunch of widget types to get you started:

In addition, some of brick's more powerful features may not be obvious right away:

Brick-Users Discussion

The brick-users Google Group / e-mail list is a place to discuss library changes, give feedback, and ask questions. You can subscribe at:

https://groups.google.com/group/brick-users

Status

There are some places were I have deliberately chosen to worry about performance later for the sake of spending more time on the design (and to wait on performance issues to arise first). brick is also something of an experimental project of mine and some aspects of the design involve trade-offs that may are not entirely settled. In addition you can expect this library to follow a principle of fearless improvement: new versions will make (sometimes substantial) API changes if those changes really do make the library better. I will place more importance on getting the API right than on maintaining backwards compatibility.

brick exports an extension API that makes it possible to make your own packages and widgets. If you use that, you'll also be helping to test whether the exported interface is usable and complete!

Reporting bugs

Please file bug reports as GitHub issues. For best results:

Contributing

If you decide to contribute, that's great! Here are some guidelines you should consider to make submitting patches easier for all concerned: