我是ocaml的新手,通過了一些教程,並認爲對於下一步,我會通過閱讀一些OOS來熟悉語法。所以我從facebook上下載了Flow。運營商'|>'在Facebook的流程
但是,我遇到了一些奇怪的使用'|>'的語法,我無法弄清楚。
首先,我所遇到的「|>」 here:
args = CommandSpec.ArgSpec.(
empty
|> flag "--tokens" no_arg
~doc:"Include a list of syntax tokens in the output"
|> flag "--pretty" no_arg
~doc:"Pretty-print JSON output"
|> CommandUtils.from_flag
|> anon "file" (optional string) ~doc:"[FILE]"
)
當我在尋找它的定義,我發現這在另一個文件:
let (|>) (o : 'a) (f : 'a -> 'b) : 'b = f o
但我不太清楚它在做什麼或者甚至是相關的。
你能幫忙嗎?
'你知道這是內聯':是否與其他語言的'中綴'相同? – Laurent
正確的詞是中綴,答案應該是固定的。 – Drup
固定,謝謝你們。 –