3 ms·
Consider the example code here in Hack, const weather = `https://api.weather.gov/gridpoints/TOP/31,80/forecast` |> await fetch(%) |> await %.json()
by maxloh 4y ago
Consider the example code here in Hack,
const weather = `https://api.weather.gov/gridpoints/TOP/31,80/forecast`
|> await fetch(%)
|> await %.json()
|> %.properties.periods[0]
In F# it would be much more verbose,
const weather = `https://api.weather.gov/gridpoints/TOP/31,80/forecast`
|> fetch
|> await
|> json
|> await
|> x => x.properties.periods[0]
// or |> { properties : { periods: [result] } } => result
Hack will also requires less key strikes for calling functions that have multiple augments.
- pharmakom 4y agoNumber of key strokes is only one design consideration and not even a very important one