# \#adt

**URL:** https://discuss.ocaml.org/tag/adt/279.md

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

---

## [Narrowing variant types alternatives](https://discuss.ocaml.org/t/narrowing-variant-types-alternatives/3806)

<div class="topic-metadata">

**Author:** [@ale](https://discuss.ocaml.org/u/ale)\
**Replies:** 11\
**Last updated:** [May 21, 2024, 11:22am UTC](https://discuss.ocaml.org/t/narrowing-variant-types-alternatives/3806 "2024-05-21T11:22:55Z")

</div>

Consider the following type representing types in a programming language: type t = | Name of string | Record of (string \* t) list | Array of (t \* int) Is there a way to limit the type t in Array of (t \* int) to b…

---

## [Generating inhabitants of (G)ADT](https://discuss.ocaml.org/t/generating-inhabitants-of-g-adt/4955)

<div class="topic-metadata">

**Author:** [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Replies:** 1\
**Last updated:** [January 4, 2020, 2:33pm UTC](https://discuss.ocaml.org/t/generating-inhabitants-of-g-adt/4955 "2020-01-04T14:33:06Z")

</div>

I have a pattern matching construction where I know patterns and a type of scrutinee, and I want to generate all values/examples of this type to test, for example, that my pattern matching is exhaustive (It’s kind of com…

---

## [Simplest way to recognize a primitive type?](https://discuss.ocaml.org/t/simplest-way-to-recognize-a-primitive-type/2984)

<div class="topic-metadata">

**Author:** [@RogerT](https://discuss.ocaml.org/u/RogerT)\
**Replies:** 6\
**Last updated:** [December 1, 2018, 5:40pm UTC](https://discuss.ocaml.org/t/simplest-way-to-recognize-a-primitive-type/2984 "2018-12-01T17:40:42Z")

</div>

I was working with GADT (where all is so strongly typed… which is first painful then gives satisfaction). Going back to a case with ADT type, I felt surprised not to be able to answer to the following question (when pat…
