Concept Flow - Type predicates in practice
Start with unknown type
Call type predicate function
Function returns true or false
Yes No
Narrow type
Use narrowed type
End
We start with a value of unknown type, use a type predicate function to check its type, then narrow the type based on the result to safely use it.