Closed ptitjes closed 7 years ago
I think Default
and convert(...)
are somewhat different (see Philippe's comments in ValHandler.scala on why). However, I think we could indeed replace convert
by something that returns an option and use the defaultValue
as a getOrElse to reduce duplication.
Please open a PR if you want this changed :)
Well, I tried to implement it without success. Scala's implicit handling impose that the implicit resolution of the converter occurs where the type is fully know (hence in ValHandler
's subclass...).
Closing.
It seems to me that implementing
convert(...)
in everyValHandler
subclasses defeats the purpose of theDefault
type-class.I'm willing to make a PR for this.