Type Signature

Noun · Development

Definitions

  1. The declared types of a function's parameters and return value, expressing the contract of what goes in and what comes out — such as `(string, number) => boolean` in TypeScript or `map :: (a -> b) -> [a] -> [b]` in Haskell. Type signatures serve as both compiler-checked documentation and the primary way developers understand a function's interface.

    In plain English: A compact description of what types a function takes as input and what type it gives back, like a recipe's ingredient list and result.

    Example: "I can tell what the function does just from its type signature — it takes a predicate and a list, and returns a filtered list."

Related Terms