On 20 January 2018 at 23:36, john skaller <[email protected]> wrote:
> One supplies read and write functions to views, but is there a way to get
> them back?
Yes, via coerce. Given a view created as follows
let v = view ~read:f ~write:g t
the read and write functions f and g are both available as coercions
between the view and the underlying type:
f ≡ coerce t v
g ≡ coerce v t
_______________________________________________
Ctypes mailing list
[email protected]
http://lists.ocaml.org/listinfo/ctypes