syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Inline apply syntax for functors is not supported

Open Lomand opened this issue 3 years ago • 0 comments

Functors provide a way to describe your types in a more concise way. Compare these two examples:

Belt.Map.t<Name.t, animal, Name.identity>
MapOf(Name).t<animal>

In Reason it works perfectly fine

In Rescript it results in a syntax error.

This can be circumvented by

module NameMap = MapOf(Name)
let xs: NameMap.t<animal> = failwith("impl")

but this far cry from clean inline declaration that is available in Reason.

Lomand avatar Jan 23 '22 20:01 Lomand