arrow-refined-types / arrow.refinement / ensure

ensure

fun ensure(vararg constraints: Pair<Boolean, String>): Constraints

Builds Constraints from a variadic array of predicate checks and failure messages. The arrow-refined compiler plugin uses this function to analyze and validate compile time calls to refined types constructors

import arrow.refinement.ensure

ensure(true to "passed", false to "failed")
// [(true, passed), (false, failed)]

Do you like Arrow?

Arrow Org
<