Hello Arnaud,

Do you have any good suggestions?

I think the consensus is that one should write pure code by default, and only switch to imperative style when there is a good reason for it (eg an algorithm or data structure that is harder to express in pure style). Pure code is easier to read and reason about in most cases.

What would be an appropriate way for me to request feedback?

I would recommend you head over to https://discuss.ocaml.org/ to get feedback to all your OCaml-related questions.

Cheers,
Nicolas

De : caml-list-request@inria.fr <caml-list-request@inria.fr> de la part de Arnaud Delobelle <arnodel@gmail.com>
Envoyé : mercredi 29 décembre 2021 17:09
À : caml-list@inria.fr <caml-list@inria.fr>
Objet : [Caml-list] Learning ocaml
 

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hello!

In 1993 while doing a maths degree at Paris 7 university I remember doing a project in a language called Caml-Light (implementing a unification algorithm iirc).  I haven't done any Caml since but this Christmas I decided to give Ocaml a go (just for the fun of it).

As I'm learning I am wondering how to write idiomatic OCaml - as an example, as it has both functional and imperative syntax, I'm finding it hard to decide what is most natural in some situations.  Do you have any good suggestions?

My favourite way to learn is by doing and getting feedback.  What would be an appropriate way for me to request feedback?  It would be for fairly simple code.

TIA

Arnaud Delobelle