concept condition in category kotlin
appears as: conditions, condition, conditions, condition, The condition

This is an excerpt from Manning's book The Joy of Kotlin.
Finding conditions that should hold Finding conditions that shouldn’t hold
Write a function
filtertaking a condition that’s represented by a function fromAtoBooleanand returning aResult<A>, which will beSuccessorFailure, depending on whether the condition holds for the wrapped value. The signature will be this:fun filter(p: (A) -> Boolean): Result<A>Create a second function taking a condition as its first argument and a
Stringas a second argument, using the string argument for the potentialFailurecase.