I know OCaml has List.append, but does it have an operator like Haskell's ++?
For lists:
# (@);;
- : 'a list -> 'a list -> 'a list = <fun>
# [1;2;3] @ [4;5;6];;
- : int list = [1; 2; 3; 4; 5; 6]
For strings:
# (^);;
- : string -> string -> string = <fun>
# "abc" ^ "def";;
- : string = "abcdef"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With