pakoito
07/02/2018, 6:15 PMJose Antonio Jimenez
07/03/2018, 7:50 AMJose Antonio Jimenez
07/03/2018, 7:52 AMJose Antonio Jimenez
07/03/2018, 7:52 AMJose Antonio Jimenez
07/03/2018, 9:16 AMval message = ObjectMapper().writeValueAsString(null)
Option.fromNullable(message)
Some(null)
pakoito
07/03/2018, 9:51 AM.flatMap { it.firstOption() }
if the first record is null it should be Some(null)
sadly. Try it.filter { it != null }.firstOption()
pakoito
07/03/2018, 9:53 AMfromNullable()
seems like a straightforward implementation that cannot fail: https://github.com/arrow-kt/arrow/blob/cde3876ab8e649941f6805ea72fa985a121d6bce/modules/core/arrow-core/src/main/kotlin/arrow/core/Option.kt#L29pakoito
07/03/2018, 9:53 AMString!
, right? After being nullchecked it should become String
Jose Antonio Jimenez
07/04/2018, 8:35 AMval message = ObjectMapper().writeValueAsString(null)
i obtain Some(null) when Option(message)
(Scala) or Option.fromNullable(message)
(Kotlin)pakoito
07/04/2018, 9:31 AMSome(null)
, by println the value or with the debugger?pakoito
07/04/2018, 9:33 AMwriteValueAsString(null)
seems to me like something that’ll return a string "null"
, which then gets printed as Some(value = "\"null\"")
and that may be correct and te corro a gorrazosJose Antonio Jimenez
07/04/2018, 12:56 PMJose Antonio Jimenez
07/04/2018, 1:10 PMpakoito
07/04/2018, 3:13 PMpakoito
07/04/2018, 3:13 PM