reasonml-community / belt

MIT License
49 stars 1 forks source link

Operators #28

Open fakenickels opened 6 years ago

fakenickels commented 6 years ago

Would be cool if it provided some well-known operators like and some others to work with Js.t

(>>=) = bind (for options)

// the dot would be to recall the {. } syntax shotcut for JS objects in Reason

(||.) = defaults Js.Null_undefined
// nullableStringFn() ||. "default!"

(>>=.) = Bind Js.Null_undefined
// nullableObjectReturn >>=. (x => x##foo) >>=. (foo => foo##bar) ||. "default!"

etc