reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.13k stars 430 forks source link

A sugar for function application ending with unit? #1877

Closed bobzhang closed 3 months ago

bobzhang commented 6 years ago

suppose we have a function whose type is

val f :  ?a0:int -> a1: int -> ?a2:int -> unit -> t  

In most cases, you dont want an accidential currying happens(see https://github.com/BuckleScript/bucklescript/issues/2670), you would write

f ~a1:3 ()

I imagine if in reason, we can have a small sugar like this

f(~a1=3 .)

Some random thoughts, not of high priority

jordwalke commented 6 years ago

I have a larger proposal that goes even further and doesn’t require the dot.