# \[BLOG\] Effective ML Through Merlin's Destruct Command

**URL:** <https://discuss.ocaml.org/t/blog-effective-ml-through-merlins-destruct-command/14751>\
**Category:** Ecosystem\
**Tags:** merlin, editor, ocaml-lsp-server, blog\
**Created:** [June 5, 2024, 9:46am UTC](https://discuss.ocaml.org/t/blog-effective-ml-through-merlins-destruct-command/14751 "2024-06-05T09:46:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![xvw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/xvw/32/2041_2.png) [@xvw](https://discuss.ocaml.org/u/xvw)\
**Post date:** [June 5, 2024, 9:46am UTC](https://discuss.ocaml.org/t/blog-effective-ml-through-merlins-destruct-command/14751/1 "2024-06-05T09:46:28Z")

</div>

I’m very pleased to present you [an article](https://tarides.com/blog/2024-05-29-effective-ml-through-merlin-s-destruct-command/) with a collection of small illustrations and examples of how to use the `destruct` command to generate patterns in the presence of pattern matches.

The command has been present in [Merlin](https://ocaml.org/p/merlin/latest) for several years (and accessible via [OCaml-LSP](https://ocaml.org/p/lsp/latest)) but, as the various changelogs relating to Merlin mention, we have spent some time polishing it and adapting it to the evolutions of OCaml, making it more stable (essentially in the presence of punning) and taking into account the changes made to the representation of functions (and their parameters).

The aim of the article is to show how the `destruct` command works in a number of very concrete cases, and ends with an example (a little artificial for the purposes of the article and for teaching purposes) which shows how to use `destruct` interactively.

- [Effective ML Through Merlin’s Destruct Command](https://tarides.com/blog/2024-05-29-effective-ml-through-merlin-s-destruct-command/): original article, written in English, on the Tarides blog.
- [Effective ML, au travers de la commande ‘destruct’](https://xvw.lol/pages/ocaml-merlin-destruct.html): A French-language interpretation of the article, published on my blog.

Can’t wait to hear your feedback! Happy reading!

---

_[View the full topic](https://discuss.ocaml.org/t/blog-effective-ml-through-merlins-destruct-command/14751)._
