I'm learning Haskell and trying to grasp how exactly Haskell type system works re working out what is the type of the thing: dynamic, static, set manually, inferred?
Languages I know a bit:
C, Java: set manually by a programmer, verified at compile time, like
int i;
, strong typing (subtracting integer from a string is a compile error). Typical static type system.Python: types inferred automatically by runtime (dynamic typing), strong typing (subtracting
int
from astr
raises exception).Perl, PHP: types inferred automatically at runtime (dynamic typing), weak typing.
Haskell: types often inferred automatically at compile time (either this or type is set explicitly by a programmer before compile time), strong typing.
Does Haskell's type system really deserve description "static"? I mean automatic type inference is not (classic) static typing.