(no title)
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#$...
geofft|6 years ago
All I'm saying is that Haskell doesn't seem to do anything different here - Rust has incorporated the lessons from Haskell's type system. (As someone who fell in love with Haskell a long time ago but never got to use it professionally, this is basically why I like Rust.) Is there something Haskell does that Rust does not do? I'm not trying to say Haskell is insufficient - I'm just refuting the claim that Rust is insufficient and should act more like Haskell.
EvilTerran|6 years ago
masklinn|6 years ago
Great so instead of `xs !! n` you're supposed to write
that seems… less than likely?