# Why do I need to repeat type declarations between interfaces and implementations (or how do I get around this)?

**URL:** <https://discuss.ocaml.org/t/why-do-i-need-to-repeat-type-declarations-between-interfaces-and-implementations-or-how-do-i-get-around-this/3350>\
**Category:** Learning\
**Created:** [February 16, 2019, 3:31am UTC](https://discuss.ocaml.org/t/why-do-i-need-to-repeat-type-declarations-between-interfaces-and-implementations-or-how-do-i-get-around-this/3350 "2019-02-16T03:31:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 16, 2019, 3:49am UTC](https://discuss.ocaml.org/t/why-do-i-need-to-repeat-type-declarations-between-interfaces-and-implementations-or-how-do-i-get-around-this/3350/2 "2019-02-16T03:49:58Z")

</div>

Yeah people keep hitting this:

- [https://stackoverflow.com/q/22348341/20371](https://stackoverflow.com/q/22348341/20371)
- [https://stackoverflow.com/q/3238509/20371](https://stackoverflow.com/q/3238509/20371)
- [Avoiding duplicated definitions in module implementation and interface](https://discuss.ocaml.org/t/avoiding-duplicated-definitions-in-module-implementation-and-interface/1546)

There are a couple of tricks you can use to work around it in some situatuons.You already discovered the ‘top-down development’ trick, there’s also a ‘recursive modules’ trick which works for modules that contain only type definitions (and also external definitions): [https://blog.janestreet.com/a-trick-recursive-modules-from-recursive-signatures/](https://blog.janestreet.com/a-trick-recursive-modules-from-recursive-signatures/) . This one actually also works with a single module.

---

_[View the full topic](https://discuss.ocaml.org/t/why-do-i-need-to-repeat-type-declarations-between-interfaces-and-implementations-or-how-do-i-get-around-this/3350)._
