summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/shared/elm/Shared/Util')
-rw-r--r-- | src/shared/elm/Shared/Util/Array.elm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shared/elm/Shared/Util/Array.elm b/src/shared/elm/Shared/Util/Array.elm index 234b4c4..a68aa5e 100644 --- a/src/shared/elm/Shared/Util/Array.elm +++ b/src/shared/elm/Shared/Util/Array.elm @@ -1,7 +1,7 @@ module Shared.Util.Array exposing ( update, - update_unsafe, + update_or_insert, filter_first, indexed_search ) @@ -9,24 +9,24 @@ module Shared.Util.Array exposing import List import Array -update : ( +update_or_insert : ( Int -> ((Maybe t) -> (Maybe t)) -> (Array.Array t) -> (Array.Array t) ) -update index fun array = +update_or_insert index fun array = case (fun (Array.get index array)) of Nothing -> array (Just e) -> (Array.set index e array) -update_unsafe : ( +update : ( Int -> (t -> t) -> (Array.Array t) -> (Array.Array t) ) -update_unsafe index fun array = +update index fun array = case (Array.get index array) of Nothing -> array (Just e) -> (Array.set index (fun e) array) |