the.bay.news

[a,b,c,d] for a,b,c,d::Union{Float64,Int} fails type prediction at seemingly no benefit

Julia Programming Language
[a,b,c,d] for a,b,c,d::Union{Float64,Int} fails type prediction at seemingly no benefit
I have recently already asked related questions, but type prediction for union types has unfortunately become a gift for me that keeps on giving. Replacing Base.promote_typeof by a simpler implementation seems at no loss for me, but makes an v = [a,b,c,d] equivalent quite a lot faster when for instance a,b,c,d::Union{Float64,Int} is inferred. It also leads to perfect type prediction v::Union{Vector{Float64}, Vector{Int}} whereas Base implementation does not. I was in particular suprised that u...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.