added practicum files, updated gitignore
[fp1415.git] / files / practicum / Figure.dcl
1 definition module Figure
2
3 /** Example library to demonstrate the use of Existential Types.
4 The library implements a simple set of drawing objects.
5
6 Author: Peter Achten
7 Version: April 14 2008
8 */
9 import StdPicture
10
11 :: Figure
12
13 // drawFigure f creates a window in which f is displayed
14 drawFigure :: Figure -> *World -> *World
15
16 // convenient lifting operations on the methods of a figure to the figure self
17 move :: Vector2 Figure -> Figure
18
19 // Specialized Figure constructor functions:
20 // mkFigures figs combines all figs in left-to-right order
21 mkFigures :: [Figure] -> Figure
22
23 // line a b draws a line from a to b
24 line :: Point2 Point2 -> Figure
25
26 // rectangle a b forms a rectangle with diagonal-points a and b
27 rectangle :: Point2 Point2 -> Figure
28
29 // ellips a b forms an ellips that fits in the rectangle with diagonal-points a and b
30 ellips :: Point2 Point2 -> Figure
31
32 // text t a shows a text t with left-top corner at a
33 text :: String Point2 -> Figure