aboutsummaryrefslogtreecommitdiff
blob: 8088244cc6d9826defbab79e2fec23844712c93b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Util.Array exposing (update)

import Array

update : (
      Int ->
      ((Maybe t) -> (Maybe t)) ->
      (Array t) ->
      (Array t)
   )
update index fun array =
   case (fun (Array.get index array)) of
      Nothing -> array
      (Just e) -> (Array.set index e array)