let take t ~index = let l = A.length t in if index < 0 then A.empty else if index >= l then t else A.sub_exn t ~index:0 ~length:index