flatten_array = (a)-> unless a? return null else if a.length is 0 return [] else return ( a.reduce (l,r)->l.concat(r) )