RaymondT (15) [Avatar] Offline
#1
The code snippet on page 314 shows:

object STArray {
def apply[S,A : Manifest](sz: Int, v: A ) : ST[S, STArray[S,A]] =
new STArray[S,A] {
lazy val value = Array.fill(sz)(v)
}
}

should be :

object STArray {
def apply[S,A : Manifest](sz: Int, v: A ) : ST[S, STArray[S,A]] =
ST(new STArray[S,A] {
lazy val value = Array.fill(sz)(v)
})
}

instead. Thank you.