loading...

re: Optional chaining in Reason VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What is it to add the second type using and doesThisExist = {orThis: option(string)}; Seems like its interchangeable with: type doesThisExist = ...
 

You are correct that either way would work. and is used for mutually recursive types. The only thing it does here is let us write our types in reverse order (so in this case, they’re not really mutually recursive).

reasonml.github.io/docs/en/more-on...

Being able use and to write nested type definitions “backwards” can look nice (IMO) when nesting a very large number of types.

code of conduct - report abuse