I want to write a function to return false for this case
let mylist = [ [ ] ];;
return true for this case
let mylist = [ [1] ];;
and return true for this case
let mylist = [ [ ] ; [1] ];;
How can I do this?
I want to write a function to return false for this case
let mylist = [ [ ] ];;
return true for this case
let mylist = [ [1] ];;
and return true for this case
let mylist = [ [ ] ; [1] ];;
How can I do this?
You will want to read about pattern matching.
Pattern matching and List flattening will help.
https://caml.inria.fr/pub/docs/manual-ocaml/libref/List.html
What about []
? [[];[]]
?