-
Notifications
You must be signed in to change notification settings - Fork 12
Validation
Alex Zuzin edited this page Apr 13, 2017
·
2 revisions
An ad-hoc validation can be created the usual way:
val invalid: Validation<Tuple2<Int, Int>, String> = invalid("your value sucks")
val valid: Validation<Tuple2<Int, Int>, String> = valid(tuple(7, 11))
A Kotlin Iterable
of Validation
s can be sequenced as follows:
val validOfSeq: Validation<List<Int>, Seq<String>> =
listOf(valid(1), invalid("not one at all")).sequence()
JΛVΛSLΛNG, (C) 2014 - 2017 javaslang.io