Was looking through compose sources, they use the ...
# arrow-meta
s
j
I'd say that their idea is much different and more similar to their StringDef, IntDef annotations.
Not to mention
AdditionalTypeChecker
can only make checking more strict, while Meta makes it less strict
r
Yeah I think conceptually everyone in the community wants union types and we plan to propose these as a a joint keep with type proofs at the base. It was mentioned a few times in the closing panel, everyone wants union types and type classes but that may not be JB priorities which is fine, that’s why we built meta so we can have some of these things as plugins until they make it to the lang if they ever do and we can propose this thing faster than hacking on the compiler on a fork. The ones in Arrow follow the laws of the dot calculus or dotty for Union types. so they are a little more than just a Coproduct of types. For example they are commutative and have native support for nullable types.
Copy code
val a: String = "".combine("")
val b: String = String.empty()
val c: Union2<String, Double> = a
val d : Union2<Double, String> = c
val f: String? = d
val g: Union2<String, Int> = f or 1
val h: Union3<Int, String, Double> = 1 or "hello" or 0.0 //0.0
đŸ¤˜ 1