forked from lamdu/lamdu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTUTORIAL
52 lines (31 loc) · 1.6 KB
/
TUTORIAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Some instructions to get you started with this preliminary[toy] code editor:
1. Install the ftgl C bindings and other dependencies. If you're on Ubuntu, use:
sudo apt-get install libftgl-dev libftgl2 libxi-dev libxrandr-dev happy
2. OPTIONAL: Install fork of FTGL bindings which more gracefully handles missing font files:
git clone https://github.com/Peaker/FTGL
cd FTGL
cabal install
3. Build and install lamdu's dependencies and lamdu itself:
cabal install
Alternatively, you can:
cabal install --only-dependencies
cabal configure
cabal build
But this will require running the Editor directly from the
source root dir, because without an install, it will search the
font only relatively to the directory from which it was executed.
4. Run lamdu, either from your cabal bindir [e.g: ~/.cabal/bin/Editor], or from the build directory (dist/build/Editor/Editor).
5. Press: alt-n (make new definition)
6. Type this line into the Editor slowly, key-by-key, including
spaces, and examine what happens after each key stroke:
fac x=if x=0 1 x*f x-1
NOTE: If you make a mistake at any time, use undo/redo (Ctrl-z, Ctrl-y)
This should result in:
fac x = if (x == 0) 1 (x * fac (x - 1))
Type information is used to filter out non-sense and offer more
sensible edit operations gven your keys, ando ne of the side
effects is having to input much less.
This toy example took 22 key strokes instead of 39 required by an ordinary text editor.
7. Move cursor to the "fac" application in "fac (x - 1)"
8. Press <return> to jump to the definition
9. Press <return> again to rename. Rename it to "factorial"