Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That’s just another level. Only in five pages of explanations we come to something that is basically:

  await fetch(…)
    .catch(e =>
      new CustomError(…))
But with a wrapped-promise and flatmap nonsense for “better error handling”.

FP always goes out of the way to avoid using the language it operates in and to criticize the ways of doing something it just imagined. As if it wanted to stay as noble from unwashed peasants as it could, but has to do the same job to keep existing.

how to test () => makePayment()? (from the link)

You don’t. You test constituents like request body generation and response handling. It’s inside. You can’t test your Effect-version of this code neither. It’s a strawman.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: