# Empty polymorphic variant type use case

**URL:** <https://discuss.ocaml.org/t/empty-polymorphic-variant-type-use-case/8371>\
**Category:** Learning\
**Tags:** polymorphic-variants\
**Created:** [August 27, 2021, 12:51pm UTC](https://discuss.ocaml.org/t/empty-polymorphic-variant-type-use-case/8371 "2021-08-27T12:51:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![talex5](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/talex5/32/353_2.png) [@talex5](https://discuss.ocaml.org/u/talex5)\
**Post date:** [August 27, 2021, 12:57pm UTC](https://discuss.ocaml.org/t/empty-polymorphic-variant-type-use-case/8371/2 "2021-08-27T12:57:42Z")

</div>

It’s sometimes useful if you’re implementing a generic interface and you don’t need something in your implementation. e.g.

```ocaml
module Disk_db : DB with type error = io_error
module Memory_db : DB with type error = empty

```

Then anyone using `Memory_db` specifically knows they don’t have to worry about handling errors.

---

_[View the full topic](https://discuss.ocaml.org/t/empty-polymorphic-variant-type-use-case/8371)._
