5 ms·
Certainly favours the "O" in OCaml. OO with virtual classes seems to be used instead of functors in various places. Also, you probably want to use an stdlib rep
by mercurial 12y ago
Certainly favours the "O" in OCaml. OO with virtual classes seems to be used instead of functors in various places. Also, you probably want to use an stdlib replacement, this would help you shorten some gnarly functions like get_headers.
- eatonphil 12y agoI definitely do need to start working with a stdlib replacement. I'm planning to move to Jane Street's Core soon. I'm still pretty new to OCaml so using functors was not immediately obvious. I did plan to transition to functors for user-level configuration modules. But coming to OCaml from (e.g.) C++ has definitely influenced my default modus operandi. Thanks for the feedback!
- zem 12y agosome more feedback: the response code would be bit more readable if you started off with a record type for the args to http_response. also, a .ml file introduces an automatic module, so you don't need the toplevel module definition in most of your files. the real world ocaml section on modules is worth reading: https://realworldocaml.org/v1/en/html/files-modules-and-programs.html https://realworldocaml.org/v1/en/html/files-modules-and-prog...
- eatonphil 12y agoGreat feedback. Record type for the http_response is a good idea. Right, I really wasn't sure at first how inclusions would work out so I went a little explicit. In some cases, I felt like it was definitely a good layout (rule.ml). But overall, this will be one of the first easy refactors. Thanks!