Hi, I have had this confusion for a while. What I really want is some thing like this:
let rec reverse x= match x with |"" -> "" |e ^^ s -> (reverse s) ^ e;; (** ^^ is the operator I propose to use for string constructor *)
But it seems this is never implemented. Is there a particular reason? Is this a deliberate design choice or we just don’t think it is not needed?
I am asking because sometimes I found writing a recursive algorithm on string is useful but I have to use an accumulator/index to simulate it which is a bit clumsy.