I'm writing a program which needs a UI. The program is in haskell. For the UI, I think of using ncurses library. Should I use hscurses library for haskell and write the UI in haskell or should I use ncurses library and write the UI in C and call haskell functions from C?
Which is the most preferred way?
Asked
Active
Viewed 7,143 times
14

BenMorel
- 34,448
- 50
- 182
- 322
-
6You'll probably have an easier time doing it in Haskell, although I haven't used hsncurses myself. Going to a lower level language to implement GUI functionality seems a bit backwards. – valderman Aug 03 '11 at 09:35
1 Answers
14
I don't see any advantages in writing the UI in C and call functions from C.
You can choose how you are going to do the UI from several libraries available on Hackage:
- hscurses
- ncurses
- nanocurses
- vty and vty-ui
- ansi-terminal (on windows)
- brick — there's even a video tutorial on it.
I don't know which is better, there's a small description but not enough. Nanocurses seems more portable but with less features.

Philippe Fanaro
- 6,148
- 6
- 38
- 76

David V.
- 5,708
- 3
- 27
- 27
-
1Note that hscurses is pure binding. Its pretty ugly in that everything uses CString and stuff. I don't recommend it. – alternative Aug 03 '11 at 11:55
-
Among those libraries, hscurses seems to be complete mapping of ncurses. Yes, its pure binding, but it has all things that ncurses offer. Thanks to all for the answers and clarification. – Aug 03 '11 at 14:27
-
1vty-ui seems quite nice compared to the others, it's probably not as flexible though. – polandeer Jun 09 '14 at 03:55
-
1