Hacker News new | ask | show | jobs
by paulddraper 3457 days 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?

2 comments

In 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.
It is in Rust, although I'm sure you can come up with something where the type system won't save you.