A visual Haskell
Go to file
2017-01-04 01:47:44 -08:00
app Use customRenderSVG in Main.hs. Change font to monospace. Use optparse-applicative for Main. 2017-01-04 01:22:08 -08:00
examples Improve whitespace in tutorial. Update tutorial svg. 2017-01-04 01:47:44 -08:00
images Update to latest Stackage LTS. Upgrade diagrams-graphviz. Add images folder. 2016-08-26 20:09:09 -07:00
src Initial commit 2016-01-04 17:18:42 -08:00
test Use customRenderSVG in Main.hs. Change font to monospace. Use optparse-applicative for Main. 2017-01-04 01:22:08 -08:00
.gitignore Add pattern names to PApp. 2017-01-02 00:37:27 -08:00
glance.cabal Use customRenderSVG in Main.hs. Change font to monospace. Use optparse-applicative for Main. 2017-01-04 01:22:08 -08:00
graph_algs.txt Transfer more pseudocode from graph_algs to GraphAlgorithms. 2016-11-15 15:19:05 -08:00
LICENSE Change license to GPLv3. 2016-12-09 13:49:16 -08:00
notes.txt Convert SyntaxGraph to an FGL graph, and render it. 2016-07-02 14:43:18 -07:00
README.md Use customRenderSVG in Main.hs. Change font to monospace. Use optparse-applicative for Main. 2017-01-04 01:22:08 -08:00
Setup.hs Initial commit 2016-01-04 17:18:42 -08:00
stack.yaml Increase stackage lts and diagrams-graphviz versions. 2016-11-01 17:52:20 -07:00
todo.md Use customRenderSVG in Main.hs. Change font to monospace. Use optparse-applicative for Main. 2017-01-04 01:22:08 -08:00

Glance

Glance is a visual syntax for the programming language Haskell. The goal of this project is to increase programmer happiness and productivity by allowing programmers to understand programs in new and different ways. Currently, the Glance executable produces a visual representation of your code in the form of an SVG image when given a textual Haskell source file. In the future, I hope to incorporate Glance into Haskell code editors, and to eventually create a visual editor for Haskell.

Try it

First install Graphviz. For instance, in Ubuntu run:

sudo apt install graphviz

Then build and execute glance:

stack build
stack exec glance-exe -- examples/fact.hs images/fact.svg 500

To see the command line options run

stack exec glance-exe -- --help

Now display the SVG image

firefox --new-window images/fact.svg

You should now see in your browser window a visual representation of the factorial function. Next, you will probably want to read the Getting Started guide below to help understand the images Glance generates.

Issues

Glance is still in development, so for the time being, layout, routing, and icon design all have much room for improvement. Here are some specific issues:

  • Text boxes may not display correctly with some SVG viewers.
  • Images become very spread out when rendering medium to large functions.
  • Only a subset of Haskell is rendered

Getting started

Below is a getting started guide for Glance rendered by Glance itself (source here). To generate this image run

stack exec glance-exe -- examples/tutorial.hs examples/tutorial.svg 873 -c

Also, the Glance wiki has a brief introduction to the code architecture.

Introduction to Glance