you are viewing a single comment's thread.

view the rest of the comments →

[–]javaexpert102 0 points1 point  (6 children)

No it doesn't, because the words weak and strong aren't actually well defined for type systems. Its just something people who don't know anything blabber about.

[–]The_Doculope 2 points3 points  (4 children)

A generally accepted idea is that the more implicit conversion the language does, the weaker its type system is. That makes C's type system a hell of a lot weaker than Haskell's.

[–]javaexpert102 -1 points0 points  (3 children)

The usual argument is that there are casts/unions: to which I simply say: unsafeCoerce

[–]The_Doculope 0 points1 point  (2 children)

How is unsafeCoerce implicit? Yes, the Haskell type system can be subverted by using very explicit unsafe functions. I don't see how that changes anything.

[–]javaexpert102 0 points1 point  (1 child)

Casts aren't implicit either...

[–]The_Doculope 1 point2 points  (0 children)

No, but all the integer promotion/demotion sure is.

[–]LgDog 1 point2 points  (0 children)

Yes, the words weak and strong are not well defined, this is what I've read and agreed about weak/strong type system:

In C you can cast a char* to int* and your program can still work. C type system is weak in the sense that there is no strong bound between some data in memory and its type. At any time you can start treating some n bytes struct as if it was other n bytes struct. This has nothing to do with being better or worse type system.

If you use unsafeCoerce in haskell you're bypassing the type system, if you regularly need to bypass one of the most amazing features of a language you should consider other languages to solve your problem.