melange-re / melange-re.github.io

Documentation site for Melange
https://melange.re
25 stars 7 forks source link

Add guideline for being explicit when defining types in externals #142

Open jchavarri opened 10 months ago

jchavarri commented 10 months ago

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.