Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- utop # let do_shit lst =
- List.fold_right begin fun x acc ->
- match acc with
- | `Empty -> `String x
- | `String s -> `String (x ^ "-" ^ s)
- end
- lst
- `Empty
- |> function `Empty -> "" | `String s -> s;;
- val do_shit : bytes list -> bytes = <fun>
- utop # do_shit [];;
- - : bytes = ""
- utop # do_shit ["qwe"];;
- - : bytes = "qwe"
- utop # do_shit ["qwe"; "asd"; "zxc"];;
- - : bytes = "qwe-asd-zxc"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement