ESchouten
05/26/2021, 9:58 PMEndre Deak
05/26/2021, 10:48 PMESchouten
05/26/2021, 10:55 PMEndre Deak
05/27/2021, 12:29 AMESchouten
05/27/2021, 4:56 AMESchouten
05/27/2021, 12:50 PMJoris PZ
05/27/2021, 12:58 PMdave
05/28/2021, 6:45 AMESchouten
05/28/2021, 2:31 PMdave
05/28/2021, 2:42 PMPaymentDate.ofResult(someDate): Result<PaymentDate>
... which is much preferable from an FP validation point of view as exceptions break control flow. You can also add support for any monadic type by just adding an extension function to the ValueTypeFactory (which becomes the companion object). If you look at the code, it's been done with of()
, ofResult()
, ofResult4k()
...
Additionally, you can then provide different parse/show implementations for different purposes - so say you want to represent PaymentDate as "YYYY-MM-DD" for one system, but then want to parse/show it as "YYYY-DD-MM" on another, this is trivial toplug in.