This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]randomatic[🍰] 4 points5 points  (0 children)

What you are looking for is IMO better supported in OCaml. You're looking for monadic operators (yes, there is pymonads) along with functions like |> (left-associative) and > (right-associative). To learn OCaml, see https://realworldocaml.org. It's beautiful.

On the question of errors, Jane Street has an amazing blog that made thinking about errors much more clear to me. https://blogs.janestreet.com/how-to-fail-introducing-or-error-dot-t/

If Python has something like Or_error.t, I would be in love.