So I'm writing a simple method that sums up the first 3 or less ints in a list
but i'm confused about the match patterns.
I currently have
let sums l = match l with
| [] -> 0
| (h1::h2::h3::_) -> h1+h2+h3
| [h1;h2;h3] -> h1+h2+h3
| [h1;h2] -> h1+h2
| [h1] -> h1
Does this cover all the cases?
also how come for 3 or more elements I cant write something like [h1;h2;h3;_]?
Sorry if these question seem too simple, I just started learning OCaml and I cant find anything like this online.