RosettaCodeData/Task/Higher-order-functions/OCaml/higher-order-functions-1.ml
2024-10-16 18:07:41 -07:00

8 lines
226 B
OCaml

# let func1 f = f "a string";;
val func1 : (string -> 'a) -> 'a = <fun>
# let func2 s = "func2 called with " ^ s;;
val func2 : string -> string = <fun>
# print_endline (func1 func2);;
func2 called with a string
- : unit = ()