rawtoast
11/11/2017, 11:28 AMfind
and get
methods on collections to return Options. Whilst I found Kategory added some extensions e.g. getOption
those methods don’t seem to exist for all nullable returning collections methods. So I found myself writing the following extension method:
fun <T> T?.toOpt(): Option<T> {
return Option.fromNullable(this)
}
I feel like I must be doing something wrong! Is there a method like this in Kategory? Or should I be embracing nullable
?
… ahh just seen this: https://github.com/kategory/kategory/issues/432