Hacker News new | past | comments | ask | show | jobs | submit login

Why no? The technical term "type safety" as described in the link above, implies that each value has a type, this type doesn't change during the evolution of a program, etc. How does it differ from the guarantees we have in so-called strong-typed languages?

The fact that compiler is refusing to compile type-mismatching expression for a simple built-in types doesn't imply that it is "safer". Other languages, notably Lisp and Erlang will catch and signal the same error later, at runtime.

I am not a Haskell guru, but what I see, especially in the case of Monads, is an implicit type-tagging with additional tag - name it State, or IO, or Safe and then type-checking against them.

I cannot see the fundamental difference which gives that "extra safety".




> The fact that compiler is refusing to compile type-mismatching expression for a simple built-in types doesn't imply that it is "safer".

That's not all a statically typed language does.

Regardless, they are safer. The usual counterargument goes that this safety is too much of a burden, or not worth it, etc. But nobody I know argues they are equally safe.


>How does it differ from the guarantees we have in so-called strong-typed languages?

If you mean "dynamically typed" languages, then it differs in that they do not have types.

>The fact that compiler is refusing to compile type-mismatching expression for a simple built-in types doesn't imply that it is "safer"

No, it does not imply that. It means that.

>Other languages, notably Lisp and Erlang will catch and signal the same error later, at runtime.

Precisely. So if that piece of code was not executed, you do not know that it is incorrect. If that branch is only followed rarely, your incorrect code is out there in production waiting to blow up when it finally does run that branch.

>I am not a Haskell guru, but what I see, especially in the case of Monads, is an implicit type-tagging with additional tag

The article in question does a good job of explaining monads.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: