title: Is there an OCaml function for determining if every element of an integer list is in sequential order?
body: <p>For example, I would want to return true with the list
  [1;2;3;4], but not [1;3;4;5].</p>
  
  <p>I have tried this so far. I believe that this works based on my test cases so far... but If anyone has feedback or advice that would be great. Basically, I am unsure of how to implement it using the built-in list library that I know run more efficiently than hard-coded efforts. Could this be implemented with fold_left or fold_right?</p>
  
  <pre><code>let is_seq elt1 elt2 =
    if elt2 - elt1 = 1 then true else false
  
  let next_elem lst = 
    match lst with 
    | [] -&gt; failwith "this should not happen"
    | h :: t -&gt; h
  
  (**[is_sequential lst] returns true if the list is sequential and 
     false if it is not *)
  let rec is_sequential lst =
    match lst with
    | [] -&gt; true
    | h :: [] -&gt; true
    | h :: t -&gt; if is_seq h (next_elem t) then is_sequential t else false
  
  </code></pre>