2 ms·
It has no readability issue when you know the basic syntax * "external" is an FFI declaration * "get_internal" is the local symbol name * ":" introduces the
by masklinn 9y ago
It has no readability issue when you know the basic syntax
* "external" is an FFI declaration
* "get_internal" is the local symbol name
* ":" introduces the type signature, so "get_internal" is a function from a "map 'a 'b" (aka Map<A, B> in more C-style generics) and an 'a to a Js.undefined 'b
* followed by the external symbol ("get")
* and the stuff between brackets is a compiler instruction (an "extension point": https://whitequark.org/blog/2014/04/16/a-guide-to-extension-points-in-ocaml/ https://whitequark.org/blog/2014/04/16/a-guide-to-extension-...)