Functor

Noun · Development

Definitions

  1. In functional programming, a type that implements a map operation, allowing a function to be applied to values inside a context (like a list, option, or promise) without unwrapping it. In C++, a functor is an object that overloads the () operator.

    In plain English: A container you can apply a function to without taking things out first — like spraying paint on boxes without opening them.

    Example: "A list is a functor — map applies a function to every element without you having to write a loop."

Related Terms