# \#style

**URL:** https://discuss.ocaml.org/tag/style/221.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Partial match: Style advice](https://discuss.ocaml.org/t/partial-match-style-advice/17869)

<div class="topic-metadata">

**Author:** [@jbe](https://discuss.ocaml.org/u/jbe)\
**Replies:** 19\
**Last updated:** [March 6, 2026, 1:43pm UTC](https://discuss.ocaml.org/t/partial-match-style-advice/17869 "2026-03-06T13:43:55Z")

</div>

Consider the following two match … with statements (in f1 and f2) respectively: let g = function x when x \< 0 -\> -1 | \_ -\> 1 let f1 x = let s = g x in string\_of\_int (s \* x) ^ match\[@warning "-partial-match"\] s …

---

## [The use of CamelCase in OCaml](https://discuss.ocaml.org/t/the-use-of-camelcase-in-ocaml/11448)

<div class="topic-metadata">

**Author:** [@lukstafi](https://discuss.ocaml.org/u/lukstafi)\
**Replies:** 7\
**Last updated:** [February 2, 2026, 11:10am UTC](https://discuss.ocaml.org/t/the-use-of-camelcase-in-ocaml/11448 "2026-02-02T11:10:20Z")

</div>

Continuing the discussion from OCaml Style guide?: I wonder if any of the style guides supports using CamelCase for modules, to distinguish them from variant constructors? (If not, I’ll adapt.) In case someone does use…

---

## [Style question regarding try statement](https://discuss.ocaml.org/t/style-question-regarding-try-statement/13687)

<div class="topic-metadata">

**Author:** [@jbe](https://discuss.ocaml.org/u/jbe)\
**Replies:** 6\
**Last updated:** [December 22, 2023, 9:58am UTC](https://discuss.ocaml.org/t/style-question-regarding-try-statement/13687 "2023-12-22T09:58:13Z")

</div>

Which of the following ways to write the (procedural) function foo would be considered most idiomatic? Variant 1: let foo limit = let sum = ref 1 in let exception Limit\_reached in (try for i = 1 to 10 do …

---

## [Examples of interesting interactions of mutable and pure code](https://discuss.ocaml.org/t/examples-of-interesting-interactions-of-mutable-and-pure-code/9309)

<div class="topic-metadata">

**Author:** [@Gopiandcode](https://discuss.ocaml.org/u/Gopiandcode)\
**Replies:** 12\
**Last updated:** [November 2, 2022, 7:36am UTC](https://discuss.ocaml.org/t/examples-of-interesting-interactions-of-mutable-and-pure-code/9309 "2022-11-02T07:36:47Z")

</div>

Recently, I was looking through the implementation of various functions in the popular OCaml stdlib replacement libraries, and found this rather interesting implementation of to\_array for Seq in Containers: let to\_array…

---

## [When should types (and associated functions) form their own modules?](https://discuss.ocaml.org/t/when-should-types-and-associated-functions-form-their-own-modules/2982)

<div class="topic-metadata">

**Author:** [@MattWindsor91](https://discuss.ocaml.org/u/MattWindsor91)\
**Replies:** 4\
**Last updated:** [December 3, 2018, 9:22am UTC](https://discuss.ocaml.org/t/when-should-types-and-associated-functions-form-their-own-modules/2982 "2018-12-03T09:22:38Z")

</div>

In the Core ecosystem (and Real World OCaml as a result), there seems to be a trend towards putting types and their strongly associated functions (accessors, constructors, etc) into a singe module, so instead of type fo…

---

## [Does OCaml ecosystem have tools similar to rubocop or reek from Ruby's ecosystem?](https://discuss.ocaml.org/t/does-ocaml-ecosystem-have-tools-similar-to-rubocop-or-reek-from-rubys-ecosystem/2065)

<div class="topic-metadata">

**Author:** [@egoholic](https://discuss.ocaml.org/u/egoholic)\
**Replies:** 4\
**Last updated:** [May 31, 2018, 4:03pm UTC](https://discuss.ocaml.org/t/does-ocaml-ecosystem-have-tools-similar-to-rubocop-or-reek-from-rubys-ecosystem/2065 "2018-05-31T16:03:14Z")

</div>

Does OCaml ecosystem have tools similar to rubocop or reek from Ruby’s ecosystem? If you’re not familiar with rubocop \[https://github.com/rubocop-hq/rubocop\] and reek \[https://github.com/troessner/reek\]: both are tools f…
