Went

January 9, 2024

Building Interactive Diagrams with PureScript and GoJS

If you’re into functional programming and looking for a way to create interactive diagrams, you’re in for a treat. In this blog post, we have gathered the resources for Went, an open-source library that enables you to use PureScript and the GoJS library to build visually appealing diagrams.

 

Went: GoJS diagrams in PureScript

 

What is it?

Went is a wrapper library over purescript-gojs, a library containing bare bindings to GoJS. It supports defining diagrams declaratively with a monadic DSL that looks similar to GoJS’ make functionality.

 

Why is it?

The motivation for Went is twofold

  1. To support writing GoJS diagrams in PureScript applications. (duh)
  2. As long as we’re doing that, to address shortcomings of JavaScript and TypeScript via added type safety. For instance, Panels in GoJS that are of type Auto should not have their isOpposite property ever set – this is not currently expressible in that library, whereas in Went it is, by moving as much information as possible to the type level.

 

Introduction to Went

 

 

Source code and more examples on GitHub

 

Feel free to contact us if you have questions or needs of Went or PureScript.

Check out the Ada Beat Functional Programming blog for more topics, including functional programming principles, summaries of MeetUps, language specific articles, and much more. Whether you’re interested in functional programming theory or practical application, we have something for everyone.