GeckoGraph: A Visual Language for Polymorphic Types
Shuai Fu, Tim Dwyer, Peter J. Stuckey
TL;DR
GeckoGraph introduces a visual notation for polymorphic type annotations to complement traditional text-based type notation, with the goal of improving readability, comprehension, and comparison of complex types. The authors design a color- and shape-based diagrammatic system that encodes simple types, data types, function types, and type-class constraints, plus advanced features like kind information and precise interactivity. In a large controlled study (the Zero to Hero game) with 714 participants, GeckoGraph increased overall success rates and particularly aided novices, while not increasing task time on average. The work suggests GeckoGraph can support programming assistance, documentation, and pedagogy, and points to future directions including accessibility improvements and in-the-wild evaluations.
Abstract
Polymorphic types are an important feature in most strongly typed programming languages. They allow functions to be written in a way that can be used with different data types, while still enforcing the relationship and constraints between the values. However, programmers often find polymorphic types difficult to use and understand and tend to reason using concrete types. We propose GeckoGraph, a graphical notation for types. GeckoGraph aims to accompany traditional text-based type notation and to make reading, understanding, and comparing types easier. We conducted a large-scale human study using GeckoGraph compared to text-based type notation. To our knowledge, this is the largest controlled user study on functional programming ever conducted. The results of the study show that GeckoGraph helps improve programmers' ability to succeed in the programming tasks we designed, especially for novice programmers.
