bug_flatten.cd 319 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
let flatten_all (l : X where X = [ ( 'a \ [Any*] | X)* ]) :  [ ( 'a \ [Any*] )* ] =
    match l with
    [] -> []
    | (e \[Any*], ll) -> (e, flatten_all ll)
    | (ll1, ll2) -> (flatten_all ll1) @ (flatten_all ll2)
;;


let v = flatten_all [ `A [ `B `C  [`D]] [[[[[[[[[[[[[[[[[[[[[[[[[[1]]]]]]]]]]]]]]]]]]]]]]]]]


]]