Skip to content

Instantly share code, notes, and snippets.

View jboadas's full-sized avatar

GoodLuck jboadas

  • Solar System
View GitHub Profile
@jboadas
jboadas / array_list_flatten.ml
Created June 22, 2017 14:53
Flatten an array/list in Ocaml
(*
flatten a array/list in Ocaml
*)
(*arr is an array*)
let arr = [|[|1|];[|2|];[|3|];[|1;2;3|];[|4|];[|5|]|]
(* lst is a list *)
let lst = [[1];[2];[3];[1;2;3];[4];[5]]
(* flatten an array - preferred*)