Static typing determines types at compile time rather than allowing them to change during execution. The compiler checks that programs follow the type system’s rules before they can run, trading some flexibility for greater safety. section 1.1.2 section 2.2
Haskell combines static typing with type inference: it can infer many types from how names and functions are used, while allowing explicit type expressions when clarity or inference requires them. Top-level definitions are conventionally given explicit signatures. section 2.2
Static typing shapes implementation decisions in several ways:
- It prevents a value bound to one type from dynamically changing to another type during runtime. section 2.2
- It makes type mismatches compiler-detectable, reducing some execution-time failures. section 1.1.2
- It requires balancing safety against freedom: stronger compiler assertions restrict more operations and can make programs harder to write. section 1.1.2
An explicit type expression
A module can document a definition with a signature such as `name :: type`, followed by the corresponding definition. An expression such as `x * x` produces a value; its associated type expression specifies the type of that value. section 2.2
name :: type
Use the type-signature pattern as a compact reference for annotating names with their types. section 2.2











