# OCaml type for custom block

**URL:** <https://discuss.ocaml.org/t/ocaml-type-for-custom-block/3892>\
**Category:** Learning\
**Tags:** ffi\
**Created:** [June 6, 2019, 8:24am UTC](https://discuss.ocaml.org/t/ocaml-type-for-custom-block/3892 "2019-06-06T08:24:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unlm](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@unlm](https://discuss.ocaml.org/u/unlm)\
**Post date:** [June 6, 2019, 8:24am UTC](https://discuss.ocaml.org/t/ocaml-type-for-custom-block/3892/1 "2019-06-06T08:24:42Z")

</div>

What type should I use for [custom blocks](https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec461) (created in C code) in OCaml?

1. Is it safe to declare abstract type and then use it for custom blocks?

2. Is it safe to declare _extensible variant type with some constructors_ and then use it as a type for custom block? I.e.

---

<div class="post-metadata">

**Author:** ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)\
**Post date:** [June 7, 2019, 7:08am UTC](https://discuss.ocaml.org/t/ocaml-type-for-custom-block/3892/2 "2019-06-07T07:08:58Z")

</div>

You should declare custom blocks as abstract types on the OCaml side.
