RosettaCodeData/Task/Higher-order-functions/OCaml/higher-order-functions-1.ocaml
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

8 lines
226 B
Text

# 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 = ()