# \#let-expression

**URL:** https://discuss.ocaml.org/tag/let-expression/338.md

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

---

## ["let rec" not needed for recursion in toplevel?](https://discuss.ocaml.org/t/let-rec-not-needed-for-recursion-in-toplevel/14465)

<div class="topic-metadata">

**Author:** [@sporkl](https://discuss.ocaml.org/u/sporkl)\
**Replies:** 1\
**Last updated:** [April 10, 2024, 7:45pm UTC](https://discuss.ocaml.org/t/let-rec-not-needed-for-recursion-in-toplevel/14465 "2024-04-10T19:45:30Z")

</div>

Hi all, I’m learning OCaml, and was doing some code golfing for practice (link). I was working in utop, and I noticed that it didn’t require “let rec” for recursive function definitions: utop # let d a b=if a mod b=0 t…

---

## [Idiomatic let\*, Result.bind and Lwt.bind](https://discuss.ocaml.org/t/idiomatic-let-result-bind-and-lwt-bind/12554)

<div class="topic-metadata">

**Author:** [@mro](https://discuss.ocaml.org/u/mro)\
**Replies:** 3\
**Last updated:** [July 13, 2023, 10:25am UTC](https://discuss.ocaml.org/t/idiomatic-let-result-bind-and-lwt-bind/12554 "2023-07-13T10:25:17Z")

</div>

is that idiomatic Ocaml? let to\_let\_or\_not\_to\_let () : (unit,string) result Lwt.t = let ( let\* ) (r : ('a,'b) result) (f : 'a -\> ('c, 'b) result Lwt.t) : ('c,'b) result Lwt.t = match r with | Ok r -\> …

---

## [\[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…

---

## [Why does it become monomorphic?](https://discuss.ocaml.org/t/why-does-it-become-monomorphic/4565)

<div class="topic-metadata">

**Author:** [@milvi](https://discuss.ocaml.org/u/milvi)\
**Replies:** 3\
**Last updated:** [October 22, 2019, 6:12pm UTC](https://discuss.ocaml.org/t/why-does-it-become-monomorphic/4565 "2019-10-22T18:12:16Z")

</div>

Why is mono only monomorphic here ? let id x = x;; let apply f x = f x;; let mono = apply id;; let poly x = apply id x;; val id : 'a -\> 'a = \<fun\> val apply : ('a -\> 'b) -\> 'a -\> 'b = \<fun\> val mono : '\_weak1 -\> '\_weak…
