let concat ?(sep=[]) ll = match ll with | [] -> [] | hh :: tt -> let x = ref (List.rev hh) in List.iter tt ~f:(fun l -> x := List.rev_append sep !x; x := List.rev_append l !x; ); List.rev !x