4 ms·
> A good type system (e.g Rust's, Haskell's..) can eliminate all type errors from your programs. It depends what you call a "type error". Is calling `car` on a
by paulddraper 10y ago
> A good type system (e.g Rust's, Haskell's..) can eliminate all type errors from your programs.
It depends what you call a "type error". Is calling `car` on a `nil` instead of a `cons` a type error?
- tblair 10y agoIt is in Rust, although I'm sure you can come up with something where the type system won't save you.
- pavelludiq 10y agoIn common lisp 'nil is of type 'null which is a subtype of 'list, which is a union of the types 'null and 'cons so it wouldn't be an error. Other lisps might chose to do it differently.