From a7d7542dc646a5fd124ef71e71ce260889f1701b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 2 Feb 2016 19:24:50 +0100 Subject: Moved to 1415 directory --- 1415/files/practicum/Figure.dcl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 1415/files/practicum/Figure.dcl (limited to '1415/files/practicum/Figure.dcl') diff --git a/1415/files/practicum/Figure.dcl b/1415/files/practicum/Figure.dcl new file mode 100644 index 0000000..479ce95 --- /dev/null +++ b/1415/files/practicum/Figure.dcl @@ -0,0 +1,33 @@ +definition module Figure + +/** Example library to demonstrate the use of Existential Types. + The library implements a simple set of drawing objects. + + Author: Peter Achten + Version: April 14 2008 +*/ +import StdPicture + +:: Figure + +// drawFigure f creates a window in which f is displayed +drawFigure :: Figure -> *World -> *World + +// convenient lifting operations on the methods of a figure to the figure self +move :: Vector2 Figure -> Figure + +// Specialized Figure constructor functions: +// mkFigures figs combines all figs in left-to-right order +mkFigures :: [Figure] -> Figure + +// line a b draws a line from a to b +line :: Point2 Point2 -> Figure + +// rectangle a b forms a rectangle with diagonal-points a and b +rectangle :: Point2 Point2 -> Figure + +// ellips a b forms an ellips that fits in the rectangle with diagonal-points a and b +ellips :: Point2 Point2 -> Figure + +// text t a shows a text t with left-top corner at a +text :: String Point2 -> Figure -- cgit v1.2.3