melange-re.github.io icon indicating copy to clipboard operation
melange-re.github.io copied to clipboard

Add guideline for being explicit when defining types in externals

Open jchavarri opened this issue 2 years ago • 0 comments

Externals should list all the params of the function, and type aliases should be avoided:

external foo : int -> unit = "foo"

let () = foo 2 (* foo(2); *)

type t = int -> unit

external bar : t = "bar"

let () = bar 2 (* Curry._1(bar, 2); *)

The docs should list this guideline somehow, somewhere.

jchavarri avatar Nov 05 '23 17:11 jchavarri