reason-seoul / rescript-collection

Fast and efficient, persistent immutable collection for JS written in 100% ReScript!
https://rescript-collection.pages.dev
MIT License
56 stars 4 forks source link

PPX usage #14

Open cometkim opened 3 years ago

cometkim commented 3 years ago

It will be very nice if we support some syntax sugar using PPX

// let binding style
let%vec v = [1, 2, 3]
// extension
let v = %vec([1, 2, 3])

// thought it might be `vector{ 1, 2, 3 }` in the future, hope so

// turn into this:
let v = Vector.fromArray([1, 2, 3])
cometkim commented 3 years ago

This will need native stuff and esy configuration. But I can support :)

mununki commented 2 years ago

since the syntactic sugar was disappeared, let%vec v = ... seems not possible as far as I know. But the using extension would be feasible.

let v = %vec([1,2,3])

I think I can contribute to it. Do you want me to make a PR for this feature?

namenu commented 2 years ago

Yes please!