My Haskell implementation for this Geometric Intro problem set by Katherine. Haskell code is in
Usage for the visualizer
It doesn't require any installation if you only want to see the visualization of the current Haskell code. Just download the repo and double click on
index.html to run.
However if any Haskell code is changed, the new code needs to be re-compiled using Fay in order to show effect in the visualizer. Installation instruction for Fay can be found here.
To re-compile with Fay, go to the directory of this repo and run
fay main.hs --strict PointsAndLines,Polygons
And then double click on
p.s. Please don't change any function names, unless in
p5sketch.js in the testing functions list (starting on line 29) the name is also changed accordingly.
To make elements: press
3 to start recording.
1: record a point. Click on where to place it.
2: record a segment. Click twice to specify its endpoints.
3: record a polygon. Click to specify its vertices in order. When done, press
When not recording, click on an element to toggle selection. If clicked at places where elements overlap, it toggles all elements underneath. Selected elements are listed in order on the left of the canvas.
You can press
d to delete selected elements.
Click on a function on top left (whose required arguments are also listed).
space to feed currently selected list of elements as input to the selected function. Order of arguments matter (otherwise it crashes).
Note: some results show up as new elements added onto the canvas, but some only show as text output in the console.