Commit 16d5e7eb authored by Kim Nguyễn's avatar Kim Nguyễn

Add a test case for the full_flatten function (flattens arbitrarily deep sequences)

parent 8881be81
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]]]]]]]]]]]]]]]]]]]]]]]]]
]]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment