lambox: Text User Interface library for Haskell

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.



LamBox is a package built around the haskell ncurses bindings library to provide a high level tool that allows the creation of simple static or dynamic terminal based text user interfaces. Its main purpose is to streamline the process of creating a user interface and eliminate a lot of the boilerplate required to get ncurses up and running.

Much of this library acts within the ncurses Curses monad, which in itself is a wrapper around IO. The purpose of this library is to provide a higher level wrapper around ncurses to remove much of the boilerplate required to set up a tui, and to make building a tui a bit simpler. This library is meant to be used in conjuction with ncurses, as importing UI.NCurses is required to use the Event type, for instance.


{-# LANGUAGE OverloadedStrings #-}

module Main where

import UI.NCurses (Event(..))
import UI.Lambox

main :: IO ()
main = lambox $ do
  (box1,box2) <- do
    (b1,b2) <- splitBox config Vertical 0.5
    nb1 <- withBox b1
      [ setTitle (Just title)
      , writeStr 2 2 "Hello World!"
    nb2 <- writeStr' b2 2 2 "Press 'q' to quit!"
    pure (nb1, nb2)
  waitForGlobal (== EventCharacter 'q')
  deleteBoxes [box1, box2]
    title = Title "LamBox" AlignTop AlignRight
    config = Config 2 2 22 10 (BoxAttributes Line Nothing) ""


Dependenciesbase (>= && <4.13), lambox, ncurses (>=0.2.16 && <0.3), text (>=1.2.3 && <1.3) [details]
Copyright2019 Daniel Grinshpon
Source repositoryhead: git clone
UploadedThu Aug 8 13:47:00 UTC 2019 by Grinshpon



Maintainers' corner

For package maintainers and hackage trustees