Modeller
Coding StandardsFunctional Patterns, Results, and Errors

Functional Patterns, Results, and Errors

Composing behaviour and handling expected failure functionally instead of with exceptions and mutable state.

These standards cover representing expected failure as a value (Result/Option) instead of exceptions, composing behaviour with delegates and higher-order functions instead of class hierarchies, and working correctly with closures, iterators, and immutable collections. Apply them whenever a method's failure is expected and recoverable, or when composing behaviour that would otherwise become a class hierarchy.