3 ms·
head and (!!) have been a source of off by one errors for me. I've yet to learn Idris, but I have the hope that dependent types may save me from off by one err
by munro 11y ago
head and (!!) have been a source of off by one errors for me. I've yet to learn Idris, but I have the hope that dependent types may save me from off by one errors. Sometimes you always want head to return something, so it would be nice to find those logic errors statically.
In this case, I definitely prefer the correct version Elm implements. I think Haskell just doesn't want to admit it's type system can't model everything. :)