samoht / depyt

Yet another type combinator library
https://samoht.github.io/depyt/doc/Depyt.html
ISC License
54 stars 9 forks source link

Custom interpreters #20

Open rizo opened 5 years ago

rizo commented 5 years ago

Currently depyt provides some useful interpreters for printing, serialization, etc., but it does not provide support for implementation of custom interpreters. The public API hides the internals of the fields and variants, for example. This significantly limits the scope of applications for a generics library, in my opinion.

As a workaround I'm currently using a fork of depyt in a project that simply removes the mli file, allowing me to implement a custom interpreter for 'a Depyt.t values.

Have you thought about this restriction? Would it be possible to expose some private parts of the API to support this?

P.S. I wouldn't mind contributing these changes if we can agree on a concrete design.

nickbetteridge commented 5 years ago

This would be a useful addition - I have also had to fork and embed a custom encoder/decoder