anmonteiro / anmonteiro/httpun

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

Open
#154 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
OCaml
Stars
63
Forks
13
PR merge metrics
No merged PRs in 30d

Description

(see also anmonteiro/ocaml-h2#258)

The last two arguments of:

```ocaml
Httpun_eio.Server.create_connection_handler ... client_addr socket
```

should be switched to:

```ocaml
Httpun_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 =
Httpun_eio.Server.create_connection_handler ... client_addr socket
in
Eio.Net.run_server ... connection_handler
```

to:

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

@anmonteiro Would you accept a PR that fixed this?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.