Conditional functions for array manipulation.
Set the element at a particular index, if it is not of type Nothing. If the index is out of range, the array is unaltered.
setWhen 1 (Just 7) (Array.fromList [ 1, 2, 3 ]) == Array.fromList [ 1, 7, 3 ]Push an element onto the end of an array if the first value evalutes to True.
pushIf False 3 (Array.fromList [ 1, 2 ]) == Array.fromList [ 1, 2 ]Push an element onto the end of an array, if it is not of type Nothing.
pushWhen (Just 3) (Array.fromList [ 1, 2 ]) == Array.fromList [ 1, 2, 3 ]Append the first array only if the first parameter evalutes to True.
appendIf False (Array.repeat 2 42) (Array.repeat 3 81) == Array.fromList [ 81, 81, 81 ]Append two arrays to a new one, if the first one is not of type Nothing.
append Nothing (repeat 3 81) == fromList [ 81, 81, 81 ]Conditional mapping that is only performed, if the first parameter evalutes to True. The resulting array has to be of the same type as the input array.
Conditional filtering that is only performed, if the first parameter evalutes to True.
Conditional slice that is only performed, if the first parameter evalutes to True.
Set the element at a particular index if the condition is met. Returns an updated array. If the index is out of range, the array is unaltered.