Examples
This directory contains some small one-file example programs.
To compile and link one, just do
hbcxmake programname
without the .hs
extension.
See also the Tutorial.
Graphical User Interface Examples
- Cla.hs - a pocket calculator. Contributed
by Lennart Augustsson.
- Counter.hs - an advanced counter example,
with help bubbles.
Use
hbcxmake -contrib
to compile.
- Diagram.hs - a simple example of how to
draw diagrams.
- FacTst.hs - a program for testing the
factorial function.
- FancyHello.hs - a fancier version of
the "Hello, world!" program.
- FileBrowser.hs - simple file browser.
- FileMenu.hs - example of an
application with a standard file menu. The menu can be extended.
- Hello.hs - the "Hello, world!" program.
- Hello2.hs - the "Hello, world!" program,
with a quit button.
- NiHao.hs - Chinese version of the "Hello,
world!" program.
- NnPuzzle.hs - The 15 Puzzle. (You can
actually vary the size with the command line flags
-width
n -height n
.)
- Periodic.hs - The periodic system,
showing many of the GUI fudgets.
- SmallCounter.hs - a simple counter example.
- Sum.hs - A simple adding machine.
- Tsted.hs - a simple text editor based on
editorF
, the text editor fudget (old version).
- texteditor.hs - a simple text editor based on
editorF
, the text editor fudget (new version).
Standard I/O Interaction Examples
- Cat.hs - copies characters from standard
input to standard output.
- Talk.hs - copies strings between stdio
channels and GUI fudgets.
Real-Time Examples
Socket Communication Examples
- Telnet.hs - a simple version of the
Telnet program.