typecast array types with to_a