1 (* Copyright (C
) 2017 Matthew Fluet
.
2 * Copyright (C
) 1999-2008 Henry Cejtin
, Matthew Fluet
, Suresh
3 * Jagannathan
, and Stephen Weeks
.
4 * Copyright (C
) 1997-2000 NEC Research Institute
.
6 * MLton is released under a BSD
-style license
.
7 * See the file MLton
-LICENSE for details
.
10 structure Vector: VECTOR_EXTRA
=
12 structure V
= Sequence (Primitive
.Vector)
15 type 'a vector
= 'a vector
17 structure VectorSlice
=
20 type 'a vector
= 'a vector
23 val isSubvector
= isSubsequence
24 val span
= fn (sl
, sl
') =>
25 Primitive
.Vector.Slice
.span
26 (op = : ''a vector
* ''a vector
-> bool)
30 fun update (v
, i
, x
) =
31 (Primitive
.Vector.updateVector (v
, SeqIndex
.fromInt i
, x
))
32 handle Overflow
=> raise Subscript
34 val isSubvector
= isSubsequence
36 val unsafeFromArray
= Primitive
.Vector.unsafeFromArray
40 structure VectorSlice
: VECTOR_SLICE_EXTRA
= Vector.VectorSlice
42 structure VectorGlobal
: VECTOR_GLOBAL
= Vector
44 val vector
= Vector.fromList