As a programmer, when you call a function (or procedure or method or other piece of code), you should always check that it succeeded and if not, handle the error.

This is easy to get wrong.

A quality of a programming language is how easy it is to overlook handling of an error.

Good: Rust Result values; Python exceptions.

Bad: Unix system call integer codes; C functions that return NULL for error; shell scripts that invoke commands that can fail.

(Any command can fail.)

@liw I just love how does this with Either.. scala-exercises.org/fp_in_scal

Too bad I mainly work with and nothing as fancy as this is readily available.

Follow

@nemeciii @liw There's Purify library which I've used a little. Good option if you can't go full on FP. gigobyte.github.io/purify/

@nikoheikkila @liw this looks promising, thanks.

FP-TS has apparently progressed a lot since last spring when I last checked.
gcanti.github.io/fp-ts/

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!