A Typical Synergy: Dynamic Types and Generalised Algebraic Datatypes

Free registration required

Executive Summary

The authors present a typical synergy between dynamic types (dynamics) and Generalised Algebraic DataTypes (GADTs). The former provides a clean approach to integrating dynamic typing in a statically typed language. It allows values to be wrapped together with their type in a uniform package, deferring type unification until run time using a pattern match annotated with the desired type. The latter allows for the explicit specification of constructor types, as to enforce their structural validity. In contrast to ADTs, GADTs are heterogeneous structures since each constructor type is implicitly universally quantified.

  • Format: PDF
  • Size: 184.2 KB