# Structural equality for GADTs

**URL:** <https://discuss.ocaml.org/t/structural-equality-for-gadts/9104>\
**Category:** Learning\
**Tags:** gadt\
**Created:** [January 5, 2022, 7:39am UTC](https://discuss.ocaml.org/t/structural-equality-for-gadts/9104 "2022-01-05T07:39:20Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![viritrilbia](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/viritrilbia/32/3083_2.png) [@viritrilbia](https://discuss.ocaml.org/u/viritrilbia)\
**Post date:** [January 5, 2022, 8:02pm UTC](https://discuss.ocaml.org/t/structural-equality-for-gadts/9104/11 "2022-01-05T20:02:39Z")

</div>

I don’t think a programmer should be required to “remember that nullary variant constructors are represented as simple integers at runtime” in order to understand the behavior of a fundamental language construct like equality. Knowledge of runtime representations may be useful for performance optimization, but isn’t it part of the purpose of a high-level language like OCaml to insulate the programmer from _having_ to think about such things in order to write correct code?

---

_[View the full topic](https://discuss.ocaml.org/t/structural-equality-for-gadts/9104)._
