Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E009: Annotation Arity Mismatch

Severity: Warning

annotation for `add` has arity 1 but expression has 2 parameters; skipping

The number of arrows in the type annotation is less than the number of visible lambda parameters on the function. The annotation is skipped and inference proceeds without it.

Common causes

  • The annotation has fewer arrows than the function has parameters:
    /** type: add :: int -> int */
    add = x: y: x + y;    # 2 params, but annotation has 1 arrow
    
  • The function was refactored to take more parameters without updating the annotation.

How to fix

  • Update the annotation to match the function’s arity:
    /** type: add :: int -> int -> int */
    add = x: y: x + y;
    
  • Note: an annotation with more arrows than visible parameters is fine – the body may return a function.