Comment Comment by EvilTerran > Hoogle doesn't seem to find me a function like Rust's .get() in the standard libraryIn practice, you don't really need one - the safe alternative to "xs !! n" is pattern-matching on the result of "drop n xs", as that's [] if xs has ≤n elements:https://www.haskell.org/onlinereport/standard-prelude.html#$... parent EvilTerran 6 years ago
In practice, you don't really need one - the safe alternative to "xs !! n" is pattern-matching on the result of "drop n xs", as that's [] if xs has ≤n elements:
https://www.haskell.org/onlinereport/standard-prelude.html#$...