# \[BLOG\] Typesafe complicated combinations

**URL:** <https://discuss.ocaml.org/t/blog-typesafe-complicated-combinations/16548>\
**Category:** Learning\
**Tags:** announce\
**Created:** [April 25, 2025, 10:56am UTC](https://discuss.ocaml.org/t/blog-typesafe-complicated-combinations/16548 "2025-04-25T10:56:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rand](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/rand/32/3055_2.png) [@rand](https://discuss.ocaml.org/u/rand)\
**Post date:** [April 25, 2025, 10:56am UTC](https://discuss.ocaml.org/t/blog-typesafe-complicated-combinations/16548/1 "2025-04-25T10:56:12Z")

</div>

Heya everyone –

I’ve [written a blogpost](https://r7p5.earth/blog/2025-4-25/Typesafe%20complicated%20combinations) based on a recent experience adding typesafety to the `pmmd` codebase – handling a lot of different data and functions that needs to be combined in the right ways.

In it I make use of phantom types and OCamls module system to express the invariants - which I find is a nice set of typesystem features to express complicated relations in a relatively simple but efficient and scaleable way. Also, I think interesting design patterns can emerge from this way of working.

Let me know here if you have any questions or comments

Thanks (:

---

_[View the full topic](https://discuss.ocaml.org/t/blog-typesafe-complicated-combinations/16548)._
