Next: , Previous: Equivalence types, Up: User-defined types   [Contents]


3.2.3 Abstract types

These are types whose implementation is hidden. The type declarations

:- type t1.
:- type t2(T1, T2).

declare types t1/0 and t2/2 to be abstract types. Such declarations are only useful in the interface section of a module. This means that the type names will be exported, but the constructors (functors) for these types will not be exported. The implementation section of a module must give a definition for all of the abstract types named in the interface section of the module. Abstract types may be defined as either discriminated union types or as equivalence types.