• Contents
  • Abstract Chapter 2
  • Abstract Chapter 3
  • Abstract Chapter 4

  • Abstract Chapter 5

  • Abstract Chapter 6
  • Summary
  • Samenvatting

  • Data Abstraction

    Data abstraction mechanisms in programming languages are important tools in the process of producing reliable software. One well-known data abstraction mechanism is the abstract data type. Abstract data types either provide an abstraction of one implementation per program (single implementation), or allow the abstraction of arbitrary many implementations per program (multiple implementation). Two well-known approaches to multiple implementation abstract data types are data encapsulation and procedural encapsulation. Data encapsulation relies on a type system with existential types. Procedural encapsulation can be applied in a polymorphic Milner/Mycroft type system with algebraic types. In this chapter we investigate the incorporation of these multiple implementation abstract data types in the lazy, pure functional programming language Clean (version 1.0). The type system of Clean is based on a polymorphic Milner/Mycroft type system with algebraic types and existential types. One special feature of its type system is that it has a special linear type like type system called uniqueness types. The encorporation of the two encapsulation methods is straightforward if uniqueness types are not taken into account. However, the uniqueness type system causes complications with respect to procedural encapsulation. We present a semantically equivalent procedural encapsulation method that alleviates these complications. Finally, we compare the runtime performance of the two multiple implementation abstract data types with the standard single implementation abstract data type mechanism of Clean.