Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More direct encoding of uncurried function and type definitions #5793

Closed
2 tasks done
cristianoc opened this issue Nov 2, 2022 · 1 comment
Closed
2 tasks done

More direct encoding of uncurried function and type definitions #5793

cristianoc opened this issue Nov 2, 2022 · 1 comment
Milestone

Comments

@cristianoc
Copy link
Collaborator

cristianoc commented Nov 2, 2022

Instead of using the @bs attribute in the parser/printer followed by a PPX in the compiler: use the direct encoding.

// type t0 = (.) => int
type t0 = Js.Fn.arity0<int>

// let f0: t0 = (.) => 3
let f0: t0 = {Js.Fn.\"I0": () => 3}

// type t1 = (.int) => int
type t1 = Js.Fn.arity1<int => int>

// let f1: t1 = (.z) => z+1
let f1: t1 = {Js.Fn.\"I1": z => z + 1}
@cristianoc cristianoc added this to the v11.0 milestone Nov 2, 2022
cristianoc referenced this issue in rescript-lang/syntax Nov 2, 2022
Produce directly `Js.Fn.arityn` instead of a `@bs` annotation.

See https://github.com/rescript-lang/syntax/issues/716
@cristianoc cristianoc transferred this issue from rescript-lang/syntax Nov 10, 2022
@bobzhang
Copy link
Member

note the direct encoding would not trigger any regression.
so that we can add the direct encoding first and remove the ppx later (if needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants