validate Result
inline fun <A> A.validateResult(predicate: (A) -> Boolean, error: (A) -> Throwable): Result<A>(source)
Given a predicate and an error generating function return either the original value in a Success if the predicate evaluates as true or the error as a Failure.
eg: "hi mum".validateResult({it.contains("hi")},{ Exception("where's your manners?") })