Dynamic typing in a statically typed language
ACM Transactions on Programming Languages and Systems (TOPLAS)
Polymorphic type inference and abstract data types
ACM Transactions on Programming Languages and Systems (TOPLAS)
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
A lightweight implementation of generics and dynamics
Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
Guarded recursive datatype constructors
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Dynamic Types and Type Dependent Functions
IFL '98 Selected Papers from the 10th International Workshop on 10th International Workshop
The semantics of lazy (and industrious) evaluation
LFP '82 Proceedings of the 1982 ACM symposium on LISP and functional programming
Strongly typed heterogeneous collections
Haskell '04 Proceedings of the 2004 ACM SIGPLAN workshop on Haskell
Simple unification-based type inference for GADTs
Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
Foundations for structured programming with GADTs
Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Complete and decidable type inference for GADTs
Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
Lazy dynamic input/output in the lazy functional language clean
IFL'02 Proceedings of the 14th international conference on Implementation of functional languages
iTasks for a change: type-safe run-time change in dynamically evolving workflows
Proceedings of the 20th ACM SIGPLAN workshop on Partial evaluation and program manipulation
Hi-index | 0.00 |
We 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. Unfortunately, pattern matching only enforces structural validity and does not provide instantiation information on polymorphic types. Consequently, functions that manipulate such values, such as a type-safe update function, are cumbersome due to boilerplate type representation administration. In this paper we focus on improving such functions by providing a new GADT annotation via a natural synergy with dynamics. We formally define the semantics of the annotation and touch on novel other applications of this technique such as type dispatching and enforcing type equality invariants on GADT values.