I notice when I use map with a set collection I end up with sets of type
Any, even when the equivalent code with arrays doesn't lose the type
information. Am I doing something wrong? Check it out:
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.3 (2016-01-12 21:37 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-w64-mingw32
julia> xSet = Set{Int}([1,2,3])
Set([2,3,1])
julia> xLst = [1,2,3]
3-element Array{Int64,1}:
1
2
3
julia> typeof(xSet)
Set{Int64}
julia> typeof(xLst)
Array{Int64,1}
julia> f(x) = x+1
f (generic function with 1 method)
julia> typeof(map(f, xSet))
Array{Any,1}
julia> typeof(map(f, xLst))
Array{Int64,1}
julia>