Traverse
In functional programming, a function that combines mapping over a data structure with effects or constraints (such as Option or IO).
Traverse is a higher-order function that applies an operation to each element in a container and collects the results. Unlike ordinary map, traverse allows the operation to "fail" or have side effects—for example, applying a function that returns Option (which may fail) to each element in a list and getting back either a list of results or a failure. If any element fails the operation, the entire traversal fails.
It's particularly used in Haskell and other functional languages to provide a uniform way to "lift" ordinary operations into monadic or applicative contexts. For example, traverse parse ["1", "2", "three"] returns Nothing for the whole list if any element fails to parse. It's powerful for error handling without falling into nested if/else logic. Traverse is general enough to work with any data structure and any effect type, making it a cornerstone of functional abstraction.