TypeBlocks

Some blocks languages, such as Scratch, StarLogoTNG, and TurtleBlocks/PictureBlocks, use the shape of block connector to indicate the type of value it denotes. However, these blocks languages support only a small fixed number of connector-shapes-as-types.

TypeBlocks is a blocks language in which connector shapes can denote the arbitrarily complex types of a simple typed functional language. It has shapes for base types (number, boolean, string) that can be composed using shape constructors corresponding to standard type constructors (lists, pairs, functions) to create connectors for arbitrarily complex types. This project aims to help programmers better understand the types used in functional programming languages.  TypeBlocks was created by Marie Vasek in 2011-12 as part of her Wellesley College senior honors thesis.

TypeBlocks has three base types: int (angled connector), bool (rounded connector), and string (rectangular connector):


It has shape constructors for three type constructors: lists, pairs (*), and functions (->):

 
 
 
 list shape constructor
 pair (*) shape constructor
 function (->) shape constructor

Here are some examples of connector shapes using these constructors:

 
 
 
 
 int list
 string list list
 int*string  bool->string

 
 
 
 
 (string * bool) list
 (string list) * bool
 bool * (string -> int list)
 (bool*string) -> (int list)