Example
signature QUEUE = sig
type ‘a T;
val empty : ‘a T;
val enq: `a -> `a T -> `a T;
exception empty_queue;
val head: `a T -> `a;
val deq: `a T -> `a * `a T;
end;
structure Queue2: QUEUE = struct … end;
Any operations in struct that aren’t in sig are inaccessible
Previous slide
Next slide
Back to first slide
View graphic version