This creates a Vector from the range. Is there a way to obtain another range (I don’t care about potential accuracy loss in the conversion)? I am looking for something a bit less verbose than calling range directly:
think about what map(identity, r) should do and then if identity.(r) should return the same result. If these two should both (semantically) give you collect(r), then Float32.(r) shouldn’t return a range IMO.
map(Float32, r) appears to be exactly what I wanted for this problem. map seems to have special methods for converting the eltype of ranges by calling appropriate constructors. This is perhaps not a general solution though.