Are functors in types supported in Rescipt?

Functors give you 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.

It looks like this feature is not supported in Rescript (or am I missing something obvious?).

Functor is supported.
The inline apply syntax is not suported afaik.
so you can use it like

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

Ok, filed an issue in rescript-lang/syntax. Hopefully, we will have this in the future.