You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 2, 2024. It is now read-only.
HI,
I am a little new to Rescript. I am trying to reproduce the example in your README in Rescript. This is as far as I got:
moduleOption= {
letlet_=Belt.Option.flatMap
}
typeaddress= {street: option<string>};
typepersonalInfo= {address: option<address>};
typeuser= {info: option<personalInfo>};
// Get the user's street name from a bunch of nested options. If anything is// None, return None.letgetStreet= (maybeUser: option<user>): option<string> => {
let%Optionuser=maybeUser;
// Notice that info isn't an option anymore once we use let%Option!let%Optioninfo=user.info;
let%Optionaddress=info.address;
let%Optionstreet=address.street;
Some(street->Js.String.toUpperCase);
};
I am getting:
141 │ let%Option info = user.info;
142 │ let%Option address = info.address;
->143 │ let%Option street = address.street;
144 │ Some(street->Js.String.toUpperCase);
145 │ };
Did you forget a `=` here?
FAILED: cannot make progress due to previous errors.
>>>> Finish compiling(exit: 1)
I assume the let% syntax has to change somehow for rescript?