How do I idiomatically handle null checks from within Scala/Lift?
问题 Even with the prevalence of the Box and Option monads, we still have to check for null values here and there. The best I've come up with so far is by using the Box#!! method: (Box !! possiblyNull).map(_.toString).openOr("") Is there a better way to do this? I tried using Box's apply method: Box(possiblyNull).map(_.toString).openOr("") But the compiler complained of an ambiguous reference to an overloaded definition, specifically: [InType,OutType](value: InType) (pf: PartialFunction[InType