| 1 |
-- |
| 2 |
-- This is file `fmp-doc.hs', |
| 3 |
-- generated with the docstrip utility. |
| 4 |
-- |
| 5 |
-- The original source files were: |
| 6 |
-- |
| 7 |
-- fmp.dtx (with options: `examples') |
| 8 |
-- |
| 9 |
-- Example source code for the FMP package |
| 10 |
-- |
| 11 |
module FMPDoc where |
| 12 |
import FMP |
| 13 |
import FMPTree |
| 14 |
|
| 15 |
example1 = binom 5 |
| 16 |
where |
| 17 |
ce = circle empty |
| 18 |
binom 0 = node ce [] |
| 19 |
binom n = node ce [edge (binom i) |
| 20 |
| i <- [(n-1),(n-2)..0]] |
| 21 |
#setAlign AlignRight |
| 22 |
|
| 23 |
example2 = box (math "U" ||| |
| 24 |
ooalign [toPicture [cArea a 0.7, |
| 25 |
cArea b 0.7, |
| 26 |
cArea ab 0.4], |
| 27 |
bOverA]) |
| 28 |
where |
| 29 |
cArea a c = toArea a #setColor c |
| 30 |
bOverA = column [math "B" #setBGColor white, |
| 31 |
vspace 50, |
| 32 |
math "A" #setBGColor white] |
| 33 |
a = transformPath (scaled 30) fullcircle |
| 34 |
b = transformPath (scaled 30 & shifted (0,-30)) |
| 35 |
fullcircle |
| 36 |
ab = buildCycle a b |
| 37 |
|