The ncurses package

[Tags:gpl, library]

GNU ncurses is a library for creating command-line application with pseudo-graphical interfaces. This package is a nice, modern binding to GNU ncurses.

The following example is a program that displays the message "Hello world!" until the user hits Q:

import UI.NCurses

main :: IO ()
main = runCurses $ do
    setEcho False
    w <- defaultWindow
    updateWindow w $ do
        moveCursor 1 10
        drawString "Hello world!"
        moveCursor 3 10
        drawString "(press q to quit)"
        moveCursor 0 0
    waitFor w (\ev -> ev == EventCharacter 'q' || ev == EventCharacter 'Q')

waitFor :: Window -> (Event -> Bool) -> Curses ()
waitFor w p = loop where
    loop = do
        ev <- getEvent w Nothing
        case ev of
            Nothing -> loop
            Just ev' -> if p ev' then return () else loop


Versions 0.1,,,, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 0.2.10, 0.2.11, 0.2.12, 0.2.13, 0.2.14, 0.2.15, 0.2.16
Dependencies base (>=4.0 && <5.0), containers (>=0.2), text (>=0.7), transformers (>=0.2) [details]
License GPL-3
Author John Millikin <>
Maintainer John Millikin <>
Category User Interfaces, Foreign
Home page
Bug tracker
Source repository head: git clone
this: git clone haskell-ncurses_0.2.11)
Uploaded Tue Sep 30 06:30:18 UTC 2014 by JohnMillikin
Distributions Debian:0.2.15, NixOS:0.2.16
Downloads 5855 total (73 in the last 30 days)
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




use-pkgconfigUse pkg-config to set linker and include flags.DisabledManual
force-narrow-libraryForce including and linking against ncurses instead of ncursesw. This is only useful on systems that have the ncursesw package installed incorrectly. On most systems this will cause compile- or run-time errors.DisabledManual
force-c2hs-newtype-pointer-hooksForce using the newtype'd pointer hooks introduced in c2hs 0.18.1. This is only necessary when building with c2hs==0.18.1, as 0.18.2 and later can be auto-detected.DisabledManual

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


Maintainer's Corner

For package maintainers and hackage trustees