on master help sign in
Hopefully fix'd conflict
commita61faefbaa29f24751592ba9b472b3a36a068e41 authorChristian Widera <xash@posteo.de> dateTue 1 Apr 2014, 00:52 (13 years ago) parentab5baf6
1 file changed−16
libraries/Array.elm−16
libraries/Array.elm−16
@@ -133,18 +133,10 @@ get = Native.Array.get
133133 getMaybe 2 (A.fromList [3,2,1]) == Just 2
134134 getMaybe 5 (A.fromList [3,2,1]) == Nothing
135135-}
136−<<<<<<< HEAD
137136getMaybe : Int -> Array a -> Maybe a
138137getMaybe i array = if Native.Array.length array > i
139138 then Just (Native.Array.get i array)
140139 else Nothing
141−=======
142−safeGet : Int -> Array a -> Maybe a
143−safeGet i array =
144− if i < Native.Array.length array
145− then Just (Native.Array.get i array)
146− else Nothing
147−>>>>>>> dev
148140
149141{-| Get the element at the index. If the index is out of range, the given default
150142element is returned.
@@ -152,17 +144,9 @@ element is returned.
152144 getSafe 0 2 (A.fromList [3,2,1]) == 1
153145 getSafe 0 5 (A.fromList [3,2,1]) == 0
154146-}
155−<<<<<<< HEAD
156147getSafe : a -> Int -> Array a -> a
157148getSafe default i array = if Native.Array.length array > i
158149 then Native.Array.get i array else default
159−=======
160−getWithDefault : a -> Int -> Array a -> a
161−getWithDefault default i array =
162− if i < Native.Array.length array
163− then Native.Array.get i array
164− else default
165−>>>>>>> dev
166150
167151{-| Set the element at the index. Returns the updated array, or if the index is
168152out of range, the unaltered array.