map!, similar and eltype for DArray and SharedArrays