[racket] Is there a functional "array-set" for math/array?
Is there a functional "array-set" for math/array?
And if there isn’t, then would this be a good definition for it?:
(: array-set : (All (a) [(Array a) In-Indexes a -> (Array a)]))
(define (array-set arr update-pos val)
((inst build-array a)
(array-shape arr)
(lambda ([pos : Indexes])
(cond [(equal? pos update-pos) val]
[else (array-ref arr pos)]))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140714/5b5900f2/attachment.html>