Just my thoughts:

   - You can’t have Set{R, S} only Set{T}, Set{DataType}([R, S]) for
   example.
   - The moment you want to dispatch on those subtypes you would need to do
   something like Union{Ts...}, where Ts is an array or set of such
   subtypes.
   - Union{R, S} == Union{S, R} is true.
   - Base.length(u::Union) = length(u.types) for cardinality.

It’s an interesting thought experiment! :D
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

[email protected]

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México
<http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Frichit.com.mx%2F&si=4656540167962624&pi=2141b786-8886-4b07-84be-1a418b1636a4>

<https://www.facebook.com/richitsolution>
<http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Ftwitter.com%2Frichitsolution&si=4656540167962624&pi=2141b786-8886-4b07-84be-1a418b1636a4>
  <[email protected]>

Tel. 6718 1818
richit.com.mx

2016-01-04 21:04 GMT-06:00 Ray Toal <[email protected]>:

> All good, but I just can't see it. If I have:
>
> julia> abstract T
> julia> type S <: T; end
> julia> type R <: T; end
>
> and I ask "What are the subtypes of T?" I would expect to get back either
>
> [S,R]
>
> or
>
> [R,S]
>
> or even
>
> Set{R,S}
>
> because each of those things have cardinality 2. Because there are 2
> subsets of T. If instead I were to get back the value
>
> Union{R,S}
>
> then that would be answering the question "What are the subtypes of T?"
> with the answer "This SINGLE type whose values are all the same as the
> original type." That I **can't** understand (and would be surprised if Jeff
> would), but if everyone else thinks it makes sense, no worries! We can
> disagree. Our expectations might differ on this.
>
> I thought it was a fun thought experiment to begin with....
>
> Thanks for the discussion.
>
> On Monday, January 4, 2016 at 5:48:53 PM UTC-8, Ismael Venegas Castelló
> wrote:
>>
>> After watching the video: *Jeff Bezanzon: Julia - The base language,
>> future directions and speculations
>> <https://www.youtube.com/watch?v=xUP3cSKb8sI> *as Scott mentions,
>> returning a Union type indeed starts to make sense to me.
>>
>>
>> El sábado, 2 de enero de 2016, 13:09:43 (UTC-6), Scott Jones escribió:
>>>
>>> Going by Jeff's JuliaCon 2015 talk, and the code in
>>> examples/JuliaTypes.jl, I think returning the subtypes as a set of types
>>> (which is the same as a union of types) makes perfect sense.
>>> I'm hoping that this change does make it into 0.5, I think it does clean
>>> up a lot of bad corner cases in the current type system (which Jeff also
>>> mentioned in his talk)
>>>
>>> On Tuesday, December 29, 2015 at 5:45:51 PM UTC-5, Ray Toal wrote:
>>>>
>>>> But maybe I'm not understanding this correctly? Was it suggested that a
>>>> type union be the result of the subtypes method? I don't think that makes
>>>> sense.... The subtypes of a type is a set of types, not a type (even if
>>>> that type were the union of all the subtypes). It strikes me as a little
>>>> odd, but I may have misheard, or there might me an interpretation of it
>>>> that I haven't thought about.
>>>>
>>>> On Tuesday, December 29, 2015 at 7:02:41 AM UTC-8, Scott Jones wrote:
>>>>>
>>>>> Yes! 😄 I was hoping that Jeff had implemented something super fast
>>>>> for type unions.
>>>>
>>>>

Reply via email to