Exports of ACPrimitiveArray
Tuple(S:Type): CoercibleTo(PrimitiveArray S) with
coerce: PrimitiveArray S -> %
...
== add
Rep := Record(len : NonNegativeInteger, elts : PrimitiveArray S)
...
extend Tuple (T: Type) : with {
length: % -> SI;
element: (%, SI) -> T;
export from T;
}
== add {
Rep ==> Record(sz: SI, values: BArr);
import from Rep;
length (t: %) : SI == rep(t).sz;
element(t: %, n: SI): T == (rep(t).values.(dec n)) pretend T;
}
The pretend below is safe as long as the above files are not changed.