anmonteiro / anmonteiro/httpun

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

Ouverte
#154 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
OCaml
Étoiles
63
Forks
13
Métriques de merge des PR
Aucune PR mergée en 30 j

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?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.