Returns a new Union constructed from a conjunction of Union.
Returns a new Union constructed from a conjunction of Union.not[_] types and an additional type to add to the conjunction.
Given C = not[A] with not[B]
and T
, this method returns a Union
wrapping the equivalent of union[A] #or [B] #or [T]
.
A TypeTag
describing the conjunction of negations unwrapped from the
underlying union type is readily available via its
underlyingConjunctionTag
method.
Usage:
val binaryUnion = new Union[union [Int] #or [String]] val ternaryUnion = Union.combine( binaryUnion.underlyingConjunctionTag, typeTag[Boolean] ) ternaryUnion.typeMembers // yields Vector(Int, String, Boolean)
the starting conjunction of negations
the type to add to the conjunction before negation
Constructs a new unary union instance with the supplied type as its only member type.
Provides a facility for specifying unboxed union types of arbitrary ordinality in the Scala type system.
This clever technique was proposed by Miles Sabin: http://chuusai.com/2011/06/09/scala-union-types-curry-howard
Usage: