Luís Soares Barbosa

  A type-level approach to component prototyping

A type-level approach to component prototyping (link)
L. S. Barbosa and Jacome Cunha and Joost Visser. Proc. of SYANCO'07, pages 23-36, ACM Digital Library September 2007.


Abstract

Algebraic theories for modeling components and their in- teractions offer abstraction over the specifics of component states and interfaces. For example, such theories deal with forms of sequential composition of two components in a man- ner independent of the type of data stored in the states of the components, and independent of the number and types of methods offered by the interfaces of the combinators. Gen- eral purpose programming languages do not offer this level of abstraction, which implies that a gap must be bridged when turning component models into implementations. In this paper, we present an approach to prototyping of component-based systems that employs so-called type-level programming (or compile-time computation) to bridge the gap between abstract component models and their type-safe implementation in a functional programming language. We demonstrate our approach using Barbosa's model of com- ponents as generalized Mealy machines. For this model, we develop a combinator library in Haskell, which uses type- level programming with two effects. Firstly, wiring between components is computed during compilation. Secondly, the well-formedness of the component compositions is guarded by Haskell's strong type system.