As my title says, I am want to merge two pattern matching functions into one function. The purpose of my goal is to create a function that converts: char list -> string.
So I made two functions:
let rec urejanje list = match list with
|  -> 
| h::t -> Char.escaped h::urejanje t
let rec zdruzi list = match list with
|  -> “”
| h::t -> h^zdruzi t
Now the first one’s input is char list ex.: [‘a’;‘b’;‘c’]. The first function converts char list into string list ex: [‘a’;‘b’;‘c’] -> [“a”;“b”;“c”]
Then the second function kicks in where input is result of first function: ex: [“a”;“b”;“c”]. The second function converts string list into string ex: [“a”;“b”;“c”] ->“abc”.
what I would like to do is somehow merge this two functions into one function.
I hope I made it clear what I want.