C's ternary operator.
C's ternary operator. It uses | instead of :. Inspired by Lift's similar operator.
Example:
val str = i.isLess ? "less" | "greater"
Monoids.
Monoids.
Similar to ScalaZ's ?? operator, but ?? is annoying to use because it (the question mark) has the highest precedence.
This uses "|" because it has the lowest precedence. It uses "*" because, loosely(!) ...
true * a:A = a false * a:A = Monoid[A].Zero
Another way to read it is that "|" is usually a logical or binary operator, so it is "logical multiplication".
This is hard-coded to the String-concatenation, NodeSeq-concatenation, monad-bind, etc. monoids because they were the only real/immediate need and I'd rather get Scalaz working than re-implement it.
Example:
{ val != 0 |* another span }