anmonteiro / anmonteiro/ocaml-h2

Improve order of arguments in H2_eio.Server.create_connection_handler for currying

未關閉
#258 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
OCaml
星號
318
分支
37
PR 合併指標
30 天內沒有已合併 PR

描述

(see also anmonteiro/httpun#154)

The last two arguments of:

```ocaml
H2_eio.Server.create_connection_handler ... client_addr socket
```

should be switched to:

```ocaml
H2_eio.Server.create_connection_handler ... socket client_addr
```

This would allow for currying in `Eio.Net.run_server`, i.e. simplifying usage from:

```ocaml
let connection_handler socket client_addr =
H2_eio.Server.create_connection_handler ... client_addr socket
in
Eio.Net.run_server ... connection_handler
```

to:

```ocaml
let connection_handler = H2_eio.Server.create_connection_handler ... in
Eio.Net.run_server ... connection_handler
```

@anmonteiro Would you accept a PR that fixed this?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。