val parser = PeselParser()
val result = parser.parse("64092555585"): PeselResult -> Validation<PeselParseFailure, Pesel>
result.fold<T>({ error ->
error.description
}, { pesel ->
pesel.toString()
}): String
result.getOrElseGet { throw RuntimeException(it.description()) }: Pesel
result.toOption(): Option<Pesel>
result.orNull(): Pesel?
result.get(): Pesel // if invalid throw NoSuchElementException
crejk / pesel-parser Goto Github PK
View Code? Open in Web Editor NEWPESEL parser