Skip to content

Commit

Permalink
delete version of that uses new0
Browse files Browse the repository at this point in the history
  • Loading branch information
myegorov committed Sep 28, 2017
1 parent d4e3a42 commit 4569fe6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions basis-library/arrays-and-vectors/sequence0.sml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ functor PrimSequence (S: sig
val fromArray: 'a elt array -> 'a sequence
val isMutable: bool
val length: 'a sequence -> SeqIndex.int
val new0: (unit -> 'a sequence) option
val sameArray: 'a elt array * 'a sequence -> bool
val subUnsafe: 'a sequence * SeqIndex.int -> 'a elt
end) :> PRIM_SEQUENCE where type 'a sequence = 'a S.sequence
where type 'a elt = 'a S.elt =
struct
structure Array = Primitive.Array

val op +? = SeqIndex.+?
val op + = SeqIndex.+
val op -? = SeqIndex.-?
Expand Down Expand Up @@ -134,11 +133,6 @@ functor PrimSequence (S: sig
in
(S.fromArray a, b)
end
val unfoldi = fn (n, b, f) =>
case S.new0 of
NONE => unfoldi (n, b, f)
| SOME new0 =>
if n = 0 then (new0 (), b) else unfoldi (n, b, f)

fun unfold (n, b, f) = unfoldi (n, b, f o #2)

Expand Down Expand Up @@ -480,7 +474,6 @@ structure Vector =
val fromArray = Vector.fromArrayUnsafe
val isMutable = false
val length = Vector.length
val new0 = SOME Vector.vector0
val sameArray = fn _ => false
val subUnsafe = Vector.subUnsafe)
in
Expand All @@ -507,7 +500,6 @@ structure Array =
val sameArray = op =
val copyUnsafe = Array.copyArrayUnsafe
val fromArray = fn a => a
val new0 = NONE
val isMutable = true
val length = Array.length
val subUnsafe = Array.subUnsafe)
Expand Down

0 comments on commit 4569fe6

Please sign in to comment.