# When should I use single case constructors or type aliases?

**URL:** <https://discuss.ocaml.org/t/when-should-i-use-single-case-constructors-or-type-aliases/14816>\
**Category:** Learning\
**Created:** [June 19, 2024, 3:23am UTC](https://discuss.ocaml.org/t/when-should-i-use-single-case-constructors-or-type-aliases/14816 "2024-06-19T03:23:56Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Post date:** [June 22, 2024, 2:15pm UTC](https://discuss.ocaml.org/t/when-should-i-use-single-case-constructors-or-type-aliases/14816/22 "2024-06-22T14:15:07Z")

</div>

You can also avoid this logic issue by using modules, which is what we typically do:

```auto
module Dog = struct
  type t = { name : string }
end

module Cat = struct
  type t = { name : string }
end

```

Now we will have to create and pattern-match the record types using their explicit module names eg `{ Dog.name = "Brian" }`.

---

_[View the full topic](https://discuss.ocaml.org/t/when-should-i-use-single-case-constructors-or-type-aliases/14816)._
