OCaml语法:>> =是什么意思?

时间:2016-05-02 21:11:04

标签: ocaml

在这段代码中:

let rec write_from_exactly out s offs len =
    Lwt_unix.write out s offs len >>= fun n ->
       if   n = len then Lwt.return ()
       else write_from_exactly out s (offs + n) (len - n)
in ...

虽然我可以或多或少地猜测它的作用,但我找不到任何关于“>> = ”的含义以及它是如何工作的官方定义。

1 个答案:

答案 0 :(得分:1)

符号Handle由Lwt定义,而不是由OCaml本身定义。它是一个等价于>>=的中缀运算符。您可以在此处查看定义:Lwt module