This is similar to julia first()/last() functions instead of slicing. And they don’t throw either: first([1, 2], 4) == [1, 2].
Actually slicing a vector in haskell is also restricted to valid indices, same as in julia: e.g. Data.Vector.
This is similar to julia first()/last() functions instead of slicing. And they don’t throw either: first([1, 2], 4) == [1, 2].
Actually slicing a vector in haskell is also restricted to valid indices, same as in julia: e.g. Data.Vector.