let to_charlist (s:string) = let l = String.length s in let rec loop s l = if l=0 then [] else let l' = (l-1) in (String.get s 0)::(loop (String.sub s 1 l') l') in loop s l