Advertisement
Guest User

Untitled

a guest
Nov 28th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1.  
  2. let for_each str f =
  3. let rec helper spot final =
  4. if spot = final then ()
  5. else begin
  6. f str.[spot];
  7. helper (spot + 1) final
  8. end
  9. in
  10. helper 0 (String.length str)
  11.  
  12. let () = for_each "Hello" print_char
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement