F# tips weekly #10: Active patterns (1)
Active patterns are a great and unique feature of F#, allowing us to extend pattern matching with custom cases.
Partial Active Patterns
The most basic usage is to use active patterns as switches based on input value:
let (|PositiveInt|_|) x =
if ...
jindraivanek.hashnode.dev3 min read