arrow-refined-types / arrow.refinement / require

require

fun require(constraints: Constraints): Unit

import arrow.refinement.ensure
import arrow.refinement.require

val constraints = ensure(true to "passed", false to "failed")
try { require(constraints) } catch (e: IllegalArgumentException) { e.message }
// failed

Exceptions

IllegalArgumentException - in the event constraints has any invalid cases

Do you like Arrow?

Arrow Org
<