# \#learning

**URL:** https://discuss.ocaml.org/tag/learning/99.md

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

---

## [Semantics of recursive function declarations](https://discuss.ocaml.org/t/semantics-of-recursive-function-declarations/17878)

<div class="topic-metadata">

**Author:** [@patrick-nicodemus](https://discuss.ocaml.org/u/patrick-nicodemus)\
**Replies:** 2\
**Last updated:** [March 9, 2026, 1:15pm UTC](https://discuss.ocaml.org/t/semantics-of-recursive-function-declarations/17878 "2026-03-09T13:15:08Z")

</div>

I am studying dynamic programming and I wrote the following as an exercise let rec fibonacci = let cache : (int,int) Hashtbl.t = Hashtbl.create 100 in fun n -\> if n \<= 1 then 1 else match Hashtbl.get\_opt n with …

---

## [Learning OCaml by writing bindings for a matrix data type written in C](https://discuss.ocaml.org/t/learning-ocaml-by-writing-bindings-for-a-matrix-data-type-written-in-c/17801)

<div class="topic-metadata">

**Author:** [@marc](https://discuss.ocaml.org/u/marc)\
**Replies:** 6\
**Last updated:** [February 13, 2026, 8:07am UTC](https://discuss.ocaml.org/t/learning-ocaml-by-writing-bindings-for-a-matrix-data-type-written-in-c/17801 "2026-02-13T08:07:49Z")

</div>

Hello everyone, I’m new to OCaml and as a start I wanted to write bindings for my C fixed size vector and matrix library. I got the basics working after that I’m not sure where to continue. Any ideas would be appreciate…

---

## [Dune with MetaOCaml 5.3.0+BER help!](https://discuss.ocaml.org/t/dune-with-metaocaml-5-3-0-ber-help/17464)

<div class="topic-metadata">

**Author:** [@sebeaumont](https://discuss.ocaml.org/u/sebeaumont)\
**Replies:** 11\
**Last updated:** [November 11, 2025, 7:39pm UTC](https://discuss.ocaml.org/t/dune-with-metaocaml-5-3-0-ber-help/17464 "2025-11-11T19:39:57Z")

</div>

I’m trying to follow Oleg’s tutorials and papers on MetaOCaml and using the 5.3.0+BER switch. All I can find to help setup dune to use MetaOCaml is this Make dune works with metaocaml · Issue #1413 · ocaml/dune · GitHub …

---

## [Ppxlib: Getting the original definition of \`typ\_constr\` like \`type\_declaration\` from \`core\_type\` of \`ptyp\_constr\`](https://discuss.ocaml.org/t/ppxlib-getting-the-original-definition-of-typ-constr-like-type-declaration-from-core-type-of-ptyp-constr/15110)

<div class="topic-metadata">

**Author:** [@ttzytt](https://discuss.ocaml.org/u/ttzytt)\
**Replies:** 9\
**Last updated:** [August 16, 2024, 7:19am UTC](https://discuss.ocaml.org/t/ppxlib-getting-the-original-definition-of-typ-constr-like-type-declaration-from-core-type-of-ptyp-constr/15110 "2024-08-16T07:19:25Z")

</div>

I’m currently learning using ppxlib to write ppx deriver, and I found this tutorial. Here’s an example of automatically generating a stringify function: let rec expr\_of\_type typ = let loc = typ.ptyp\_loc in match typ…

---

## [Solving shift/reduce conflicts for optional trailing comma in menhir](https://discuss.ocaml.org/t/solving-shift-reduce-conflicts-for-optional-trailing-comma-in-menhir/15042)

<div class="topic-metadata">

**Author:** [@ttzytt](https://discuss.ocaml.org/u/ttzytt)\
**Replies:** 4\
**Last updated:** [July 30, 2024, 7:34am UTC](https://discuss.ocaml.org/t/solving-shift-reduce-conflicts-for-optional-trailing-comma-in-menhir/15042 "2024-07-30T07:34:18Z")

</div>

Optional trailing commas (or other symbols) are quite a common feature in various programming languages. For example, Rust allows you to add a trailing comma at the end of an array like this ( Array and index expression…

---

## [Ocamldoc - how to accesss special comments when writing a custom generator?](https://discuss.ocaml.org/t/ocamldoc-how-to-accesss-special-comments-when-writing-a-custom-generator/14455)

<div class="topic-metadata">

**Author:** [@0xRamzi](https://discuss.ocaml.org/u/0xRamzi)\
**Replies:** 1\
**Last updated:** [April 11, 2024, 8:42am UTC](https://discuss.ocaml.org/t/ocamldoc-how-to-accesss-special-comments-when-writing-a-custom-generator/14455 "2024-04-11T08:42:21Z")

</div>

Hello, I’m trying to make my own ocamldoc generator, and I’m having trouble finding where the actual “special comments” are. I have the following experiment code, to try and access all sorts of elements, mostly constru…

---

## [New OCaml books?](https://discuss.ocaml.org/t/new-ocaml-books/5789)

<div class="topic-metadata">

**Author:** [@Axel\_Wintermann](https://discuss.ocaml.org/u/Axel_Wintermann)\
**Replies:** 24\
**Last updated:** [February 18, 2024, 12:17am UTC](https://discuss.ocaml.org/t/new-ocaml-books/5789 "2024-02-18T00:17:36Z")

</div>

I wonder, why there are no new OCaml books since 2014 year? Many books are published on Haskell, Scala, F# themes, but no OCaml. I think we need new books for learning and for rising interest in our beautiful language.

---

## [Looking for Ideas for the Community Page at OCaml.org](https://discuss.ocaml.org/t/looking-for-ideas-for-the-community-page-at-ocaml-org/14032)

<div class="topic-metadata">

**Author:** [@shakthimaan](https://discuss.ocaml.org/u/shakthimaan)\
**Replies:** 8\
**Last updated:** [February 14, 2024, 5:48am UTC](https://discuss.ocaml.org/t/looking-for-ideas-for-the-community-page-at-ocaml-org/14032 "2024-02-14T05:48:20Z")

</div>

Greetings! As we continue to make great strides in 2024, we would like to support and grow our OCaml community! In this regard, we need to overhaul the OCaml.org Community page, similar to how we have revamped the Pack…

---

## [Access inferred types](https://discuss.ocaml.org/t/access-inferred-types/13805)

<div class="topic-metadata">

**Author:** [@mudrz](https://discuss.ocaml.org/u/mudrz)\
**Replies:** 4\
**Last updated:** [January 8, 2024, 2:19pm UTC](https://discuss.ocaml.org/t/access-inferred-types/13805 "2024-01-08T14:19:23Z")

</div>

Given type: type ('a, 'b) my\_type = { a : 'a; b : 'b } we can create a value: let my\_t : (\_, \_) my\_type = { a = 5; b = false } OCaml automatically infers its type as (int, bool) my\_type. Is there any way to access th…

---

## [Set configuration via command line arguments](https://discuss.ocaml.org/t/set-configuration-via-command-line-arguments/13668)

<div class="topic-metadata">

**Author:** [@vivanov](https://discuss.ocaml.org/u/vivanov)\
**Replies:** 1\
**Last updated:** [December 18, 2023, 4:34pm UTC](https://discuss.ocaml.org/t/set-configuration-via-command-line-arguments/13668 "2023-12-18T16:34:02Z")

</div>

Hey, I am looking to set some parameters in my program via the command line arguments. I can’t think of a way to do this. I have the following structure of my modules: ModuleA: buffer\_size = 16 depth = 10 ModuleB:…

---

## [Tutorial on Mutability, Loops, and Imperative Programming](https://discuss.ocaml.org/t/tutorial-on-mutability-loops-and-imperative-programming/13644)

<div class="topic-metadata">

**Author:** [@cuihtlauac](https://discuss.ocaml.org/u/cuihtlauac)\
**Replies:** 0\
**Last updated:** [December 15, 2023, 9:20am UTC](https://discuss.ocaml.org/t/tutorial-on-mutability-loops-and-imperative-programming/13644 "2023-12-15T09:20:04Z")

</div>

Dear OCamlers, The OCaml.org is happy to announce the release of the Mutability, Loops, and Imperative Programming tutorial which was discussed here a couple of weeks ago. We’ve included feedback from that thread. The…

---

## [New Tutorials on Basics of OCaml](https://discuss.ocaml.org/t/new-tutorials-on-basics-of-ocaml/13396)

<div class="topic-metadata">

**Author:** [@cuihtlauac](https://discuss.ocaml.org/u/cuihtlauac)\
**Replies:** 15\
**Last updated:** [November 17, 2023, 4:17pm UTC](https://discuss.ocaml.org/t/new-tutorials-on-basics-of-ocaml/13396 "2023-11-17T16:17:39Z")

</div>

Dear OCamlers The OCaml.org team is happy to announce the publication of two new tutorials: Values and Functions Basic Data Types and Pattern Matching These pages teach the basics of OCaml, starting from what is a va…

---

## [Using Reason and React meta-frameworks. Also some Melange 2](https://discuss.ocaml.org/t/using-reason-and-react-meta-frameworks-also-some-melange-2/13260)

<div class="topic-metadata">

**Author:** [@psb](https://discuss.ocaml.org/u/psb)\
**Replies:** 0\
**Last updated:** [October 17, 2023, 2:03pm UTC](https://discuss.ocaml.org/t/using-reason-and-react-meta-frameworks-also-some-melange-2/13260 "2023-10-17T14:03:48Z")

</div>

---

## [Trying to create a NextJS app using the App Router and Reason](https://discuss.ocaml.org/t/trying-to-create-a-nextjs-app-using-the-app-router-and-reason/12873)

<div class="topic-metadata">

**Author:** [@psb](https://discuss.ocaml.org/u/psb)\
**Replies:** 0\
**Last updated:** [August 21, 2023, 2:55pm UTC](https://discuss.ocaml.org/t/trying-to-create-a-nextjs-app-using-the-app-router-and-reason/12873 "2023-08-21T14:55:34Z")

</div>

---

## [Lwt and synchronisation between threads](https://discuss.ocaml.org/t/lwt-and-synchronisation-between-threads/12772)

<div class="topic-metadata">

**Author:** [@hannes](https://discuss.ocaml.org/u/hannes)\
**Replies:** 4\
**Last updated:** [August 17, 2023, 7:46am UTC](https://discuss.ocaml.org/t/lwt-and-synchronisation-between-threads/12772 "2023-08-17T07:46:08Z")

</div>

Dear all, I’m again struggle with Lwt and the synchronisation available therein. I have two pieces of code, one called by an API user (let’s name it “iwantbytes”) – another called whenever something on the network happe…

---

## [ReasonReact interop with the Auth0 ReactJS component](https://discuss.ocaml.org/t/reasonreact-interop-with-the-auth0-reactjs-component/12624)

<div class="topic-metadata">

**Author:** [@psb](https://discuss.ocaml.org/u/psb)\
**Replies:** 0\
**Last updated:** [July 16, 2023, 12:26pm UTC](https://discuss.ocaml.org/t/reasonreact-interop-with-the-auth0-reactjs-component/12624 "2023-07-16T12:26:06Z")

</div>

---

## [Getting started with ReasonReact and Melange](https://discuss.ocaml.org/t/getting-started-with-reasonreact-and-melange/12566)

<div class="topic-metadata">

**Author:** [@psb](https://discuss.ocaml.org/u/psb)\
**Replies:** 0\
**Last updated:** [July 7, 2023, 9:18pm UTC](https://discuss.ocaml.org/t/getting-started-with-reasonreact-and-melange/12566 "2023-07-07T21:18:53Z")

</div>

A short blog post on getting started with ReasonReact and Melange: Getting started with ReasonReact and Melange - DEV Community

---

## [How to make this partial-match exhaustive?](https://discuss.ocaml.org/t/how-to-make-this-partial-match-exhaustive/12181)

<div class="topic-metadata">

**Author:** [@trying](https://discuss.ocaml.org/u/trying)\
**Replies:** 4\
**Last updated:** [May 19, 2023, 10:33am UTC](https://discuss.ocaml.org/t/how-to-make-this-partial-match-exhaustive/12181 "2023-05-19T10:33:37Z")

</div>

A lazy list implementation. In ocaml5 + utop, it works with warnings: type 'a seq = | Nil | Cons of 'a \* (unit -\> 'a seq);; let head (Cons (x, \_)) = x;; let tail (Cons (\_,xf)) = xf ();; let rec from k = Cons (k, …

---

## [\[Q\] How to distinguish function definition scopes? Because compiler is complaining](https://discuss.ocaml.org/t/q-how-to-distinguish-function-definition-scopes-because-compiler-is-complaining/11729)

<div class="topic-metadata">

**Author:** [@anzhi0708](https://discuss.ocaml.org/u/anzhi0708)\
**Replies:** 4\
**Last updated:** [March 20, 2023, 4:33pm UTC](https://discuss.ocaml.org/t/q-how-to-distinguish-function-definition-scopes-because-compiler-is-complaining/11729 "2023-03-20T16:33:01Z")

</div>

Hello there! It’s me again, the OCaml noob. type choice = | Add\_semicolon | Add\_keyword\_in | Add\_nothing Now I know that you can use let f x = ... to define a function but I still get confused whether to add the keywor…

---

## [Top 5 Favorite OCaml Libraries?](https://discuss.ocaml.org/t/top-5-favorite-ocaml-libraries/10626)

<div class="topic-metadata">

**Author:** [@professor.rose](https://discuss.ocaml.org/u/professor.rose)\
**Replies:** 19\
**Last updated:** [October 20, 2022, 4:43pm UTC](https://discuss.ocaml.org/t/top-5-favorite-ocaml-libraries/10626 "2022-10-20T16:43:49Z")

</div>

Hi! I’m Christine, a technical writer at Tarides. I’d love to hear from the community on this topic. One of the misconceptions about OCaml is that there aren’t enough libraries. I’d like to write a blog article dispelli…

---

## [Illegal invocation when calling alert function using js\_of\_ocaml](https://discuss.ocaml.org/t/illegal-invocation-when-calling-alert-function-using-js-of-ocaml/9701)

<div class="topic-metadata">

**Author:** [@mooreryan](https://discuss.ocaml.org/u/mooreryan)\
**Replies:** 5\
**Last updated:** [April 20, 2022, 4:57pm UTC](https://discuss.ocaml.org/t/illegal-invocation-when-calling-alert-function-using-js-of-ocaml/9701 "2022-04-20T16:57:51Z")

</div>

I’m using js\_of\_ocaml (4.0.0) to compile OCaml to JS and using the brr library (0.0.3) to interact with the browser, but I ran into some interesting behavior. (For reference, here is the original GitHub issue about this…

---

## [Boltzgen a test generator for teachers](https://discuss.ocaml.org/t/boltzgen-a-test-generator-for-teachers/7944)

<div class="topic-metadata">

**Author:** [@benoitbarbot](https://discuss.ocaml.org/u/benoitbarbot)\
**Replies:** 4\
**Last updated:** [June 3, 2021, 8:47am UTC](https://discuss.ocaml.org/t/boltzgen-a-test-generator-for-teachers/7944 "2021-06-03T08:47:31Z")

</div>

Boltzgen a test generator for teachers. I am pleased to introduce Benoit Barbot / BoltzGen · GitLab ; Boltzgen : Boltzmann sampler test generator is a tool to generate tests. Given a function signature it generates a r…

---

## [Tooling for working on ocaml compiler](https://discuss.ocaml.org/t/tooling-for-working-on-ocaml-compiler/4631)

<div class="topic-metadata">

**Author:** [@wyn](https://discuss.ocaml.org/u/wyn)\
**Replies:** 1\
**Last updated:** [November 5, 2019, 2:43pm UTC](https://discuss.ocaml.org/t/tooling-for-working-on-ocaml-compiler/4631 "2019-11-05T14:43:16Z")

</div>

Hello, I’ve just started trying to tackle some of the junior-jobs on the ocaml issues page: https://github.com/ocaml/ocaml/labels/junior-job I’m trying to follow https://github.com/ocaml/ocaml/blob/trunk/HACKING.adoc o…

---

## [Get OCaml supported on Kattis for greater exposure?](https://discuss.ocaml.org/t/get-ocaml-supported-on-kattis-for-greater-exposure/2336)

<div class="topic-metadata">

**Author:** [@rbjorklin](https://discuss.ocaml.org/u/rbjorklin)\
**Replies:** 2\
**Last updated:** [July 25, 2018, 1:33pm UTC](https://discuss.ocaml.org/t/get-ocaml-supported-on-kattis-for-greater-exposure/2336 "2018-07-25T13:33:35Z")

</div>

Kattis is used for grading international programming competitions as well as screening during the recruitment process. Currently OCaml is missing from the list of supported languages, maybe someone higher up in the OCaml…

---

## [Functional Data Structures (Flaneries wih OCaml)](https://discuss.ocaml.org/t/functional-data-structures-flaneries-wih-ocaml/2168)

<div class="topic-metadata">

**Author:** [@vrotaru](https://discuss.ocaml.org/u/vrotaru)\
**Replies:** 0\
**Last updated:** [June 18, 2018, 7:18pm UTC](https://discuss.ocaml.org/t/functional-data-structures-flaneries-wih-ocaml/2168 "2018-06-18T19:18:48Z")

</div>

This Functional Data Structures looks like nice and accessible intro to both OCaml and basic algorithms Enjoy!

---

## [Errors using OPAM for installations](https://discuss.ocaml.org/t/errors-using-opam-for-installations/1332)

<div class="topic-metadata">

**Author:** [@trueazure](https://discuss.ocaml.org/u/trueazure)\
**Replies:** 2\
**Last updated:** [December 22, 2017, 4:26pm UTC](https://discuss.ocaml.org/t/errors-using-opam-for-installations/1332 "2017-12-22T16:26:58Z")

</div>

Hi, I have been learning OCAML and want to get the utop top level. I have OPAM installed and fully up to date, but when I go to install utop, I get a bunch of errors and failures. I’ll attach the picture, though I’m not…

---

## [Practice: Making Invalid States Unrepresentable](https://discuss.ocaml.org/t/practice-making-invalid-states-unrepresentable/1200)

<div class="topic-metadata">

**Author:** [@cpdean](https://discuss.ocaml.org/u/cpdean)\
**Replies:** 10\
**Last updated:** [November 30, 2017, 5:05pm UTC](https://discuss.ocaml.org/t/practice-making-invalid-states-unrepresentable/1200 "2017-11-30T17:05:22Z")

</div>

I’m not sure if this is the place for this, but I wanted to start a discussion that would end up being sort of a sprawling code review of a toy problem. I’m just learning OCaml. One of the exciting techniques I’ve rea…

---

## [\[ANN\] BAP tutorial](https://discuss.ocaml.org/t/ann-bap-tutorial/915)

<div class="topic-metadata">

**Author:** [@ivg](https://discuss.ocaml.org/u/ivg)\
**Replies:** 3\
**Last updated:** [October 5, 2017, 11:49am UTC](https://discuss.ocaml.org/t/ann-bap-tutorial/915 "2017-10-05T11:49:11Z")

</div>

I’m pleased to announce the BAP tutorial. Even if you’re not really interested in the binary analysis or reverse engineering, you may still find it interesting, especially if you are interested in program analysis or OCa…
