# How do you stay productive in OCaml?

**URL:** https://discuss.ocaml.org/t/how-do-you-stay-productive-in-ocaml/8221
**Category:** Learning
**Created:** [July 31, 2021, 9:04am UTC](https://discuss.ocaml.org/t/how-do-you-stay-productive-in-ocaml/8221 "2021-07-31T09:04:24Z")
**Posts on this page:** 1
**Showing post:** 15

<div class="post-metadata">

### Author: ![mudrz](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mudrz](https://discuss.ocaml.org/u/mudrz)
#### Post date: [August 1, 2021, 2:13pm UTC](https://discuss.ocaml.org/t/how-do-you-stay-productive-in-ocaml/8221/15 "2021-08-01T14:13:28Z")

</div>

I wasn’t even aware that this can be an issue - when debugging I’ve always added the externally visible types `'a, 'b` and etc.

for completeness adding:

> [@Locally abstract type, polymorphism and function signature](https://discuss.ocaml.org/t/locally-abstract-type-polymorphism-and-function-signature/4523):
>
> So I have been learning about both type theory and GADT lately and I thought I could try to encode a constructive proof on my own with GADT. I decided to encode a proof of a version of law of excluded middle for natural integer (two integers are either equal or not equal). During the process, I got puzzled by the interaction between locally abstract types and the displayed function signature. I tried a bit to reduce the problem but I am not yet very confortable and I don’t fully understand the p…

and [OCaml - Language extensions](https://ocaml.org/manual/locallyabstract.html)  
which supports both function syntaxes

```ocaml
  let rec aux : type a b. a list -> f:(a -> b) -> acc:b list -> b list =
   fun xs ~f ~acc ->
    match xs with [] -> acc | x :: xs -> aux xs ~f ~acc:(f x :: acc)

```

```ocaml
  let rec aux2 (type a b) (xs : a list) ~(f : a -> b) ~(acc : b list) : b list =
    match xs with [] -> acc | x :: xs -> aux xs ~f ~acc:(f x :: acc)

```

---

_[View the full topic](https://discuss.ocaml.org/t/how-do-you-stay-productive-in-ocaml/8221)._
